Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# Licensed under a 3-clause BSD style license - see LICENSE.rst 

2 

3# "core.py" is auto-generated by erfa_generator.py from the template 

4# "core.py.templ". Do *not* edit "core.py" directly, instead edit 

5# "core.py.templ" and run erfa_generator.py from the source directory to 

6# update it. 

7 

8""" 

9Python wrappers for the ufunc wrappers of the ERFA library. 

10 

11The key idea is that any function can be called with inputs that are arrays, 

12and the ufuncs will automatically vectorize and call the ERFA functions for 

13each item using broadcasting rules for numpy. So the return values are always 

14numpy arrays of some sort. 

15 

16For ERFA functions that take/return vectors or matrices, the vector/matrix 

17dimension(s) are always the *last* dimension(s). For example, if you 

18want to give ten matrices (i.e., the ERFA input type is double[3][3]), 

19you would pass in a (10, 3, 3) numpy array. If the output of the ERFA 

20function is scalar, you'll get back a length-10 1D array. 

21(Note that the ufuncs take this into account using structured dtypes.) 

22 

23Note that the ufunc part of these functions are implemented in a separate 

24module (compiled as ``ufunc``), derived from the ``ufunc.c`` file. 

25""" 

26 

27import warnings 

28 

29import numpy 

30 

31from . import ufunc 

32 

33__all__ = [ 

34 'ErfaError', 'ErfaWarning', 

35 'cal2jd', 'epb', 'epb2jd', 'epj', 'epj2jd', 'jd2cal', 'jdcalf', 'ab', 'apcg', 

36 'apcg13', 'apci', 'apci13', 'apco', 'apco13', 'apcs', 'apcs13', 'aper', 

37 'aper13', 'apio', 'apio13', 'atcc13', 'atccq', 'atci13', 'atciq', 'atciqn', 

38 'atciqz', 'atco13', 'atic13', 'aticq', 'aticqn', 'atio13', 'atioq', 'atoc13', 

39 'atoi13', 'atoiq', 'ld', 'ldn', 'ldsun', 'pmpx', 'pmsafe', 'pvtob', 'refco', 

40 'epv00', 'moon98', 'plan94', 'fad03', 'fae03', 'faf03', 'faju03', 'fal03', 

41 'falp03', 'fama03', 'fame03', 'fane03', 'faom03', 'fapa03', 'fasa03', 'faur03', 

42 'fave03', 'bi00', 'bp00', 'bp06', 'bpn2xy', 'c2i00a', 'c2i00b', 'c2i06a', 

43 'c2ibpn', 'c2ixy', 'c2ixys', 'c2t00a', 'c2t00b', 'c2t06a', 'c2tcio', 'c2teqx', 

44 'c2tpe', 'c2txy', 'eo06a', 'eors', 'fw2m', 'fw2xy', 'ltp', 'ltpb', 'ltpecl', 

45 'ltpequ', 'num00a', 'num00b', 'num06a', 'numat', 'nut00a', 'nut00b', 'nut06a', 

46 'nut80', 'nutm80', 'obl06', 'obl80', 'p06e', 'pb06', 'pfw06', 'pmat00', 

47 'pmat06', 'pmat76', 'pn00', 'pn00a', 'pn00b', 'pn06', 'pn06a', 'pnm00a', 

48 'pnm00b', 'pnm06a', 'pnm80', 'pom00', 'pr00', 'prec76', 's00', 's00a', 's00b', 

49 's06', 's06a', 'sp00', 'xy06', 'xys00a', 'xys00b', 'xys06a', 'ee00', 'ee00a', 

50 'ee00b', 'ee06a', 'eect00', 'eqeq94', 'era00', 'gmst00', 'gmst06', 'gmst82', 

51 'gst00a', 'gst00b', 'gst06', 'gst06a', 'gst94', 'pvstar', 'starpv', 'fk425', 

52 'fk45z', 'fk524', 'fk52h', 'fk54z', 'fk5hip', 'fk5hz', 'h2fk5', 'hfk5z', 

53 'starpm', 'eceq06', 'ecm06', 'eqec06', 'lteceq', 'ltecm', 'lteqec', 'g2icrs', 

54 'icrs2g', 'eform', 'gc2gd', 'gc2gde', 'gd2gc', 'gd2gce', 'd2dtf', 'dat', 

55 'dtdb', 'dtf2d', 'taitt', 'taiut1', 'taiutc', 'tcbtdb', 'tcgtt', 'tdbtcb', 

56 'tdbtt', 'tttai', 'tttcg', 'tttdb', 'ttut1', 'ut1tai', 'ut1tt', 'ut1utc', 

57 'utctai', 'utcut1', 'ae2hd', 'hd2ae', 'hd2pa', 'tpors', 'tporv', 'tpsts', 

58 'tpstv', 'tpxes', 'tpxev', 'a2af', 'a2tf', 'af2a', 'anp', 'anpm', 'd2tf', 

59 'tf2a', 'tf2d', 'rx', 'ry', 'rz', 'cp', 'cpv', 'cr', 'p2pv', 'pv2p', 'ir', 

60 'zp', 'zpv', 'zr', 'rxr', 'tr', 'rxp', 'rxpv', 'trxp', 'trxpv', 'rm2v', 'rv2m', 

61 'pap', 'pas', 'sepp', 'seps', 'c2s', 'p2s', 'pv2s', 's2c', 's2p', 's2pv', 

62 'pdp', 'pm', 'pmp', 'pn', 'ppp', 'ppsp', 'pvdpv', 'pvm', 'pvmpv', 'pvppv', 

63 'pvu', 'pvup', 'pvxpv', 'pxp', 's2xpv', 'sxp', 'sxpv', 

64 'DPI', 'D2PI', 'DR2D', 'DD2R', 'DR2AS', 'DAS2R', 'DS2R', 'TURNAS', 'DMAS2R', 

65 'DTY', 'DAYSEC', 'DJY', 'DJC', 'DJM', 'DJ00', 'DJM0', 'DJM00', 'DJM77', 

66 'TTMTAI', 'DAU', 'CMPS', 'AULT', 'DC', 'ELG', 'ELB', 'TDB0', 'SRS', 'WGS84', 

67 'GRS80', 'WGS72'] 

68 

69 

70class ErfaError(ValueError): 

71 """ 

72 A class for errors triggered by ERFA functions (status codes < 0) 

73 

74 Note: this class should *not* be referenced by fully-qualified name, because 

75 it may move to ERFA in a future version. In a future such move it will 

76 still be imported here as an alias, but the true namespace of the class may 

77 change. 

78 """ 

79 

80 

81class ErfaWarning(UserWarning): 

82 """ 

83 A class for warnings triggered by ERFA functions (status codes > 0) 

84 

85 Note: this class should *not* be referenced by fully-qualified name, because 

86 it may move to ERFA in a future version. In a future such move it will 

87 still be imported here as an alias, but the true namespace of the class may 

88 change. 

89 """ 

90 

91 

92# <---------------------------------Error-handling----------------------------> 

93 

94 

95STATUS_CODES = {} # populated below before each function that returns an int 

96 

97# This is a hard-coded list of status codes that need to be remapped, 

98# such as to turn errors into warnings. 

99STATUS_CODES_REMAP = { 

100 'cal2jd': {-3: 3} 

101} 

102 

103 

104def check_errwarn(statcodes, func_name): 

105 if not numpy.any(statcodes): 

106 return 

107 # Remap any errors into warnings in the STATUS_CODES_REMAP dict. 

108 if func_name in STATUS_CODES_REMAP: 

109 for before, after in STATUS_CODES_REMAP[func_name].items(): 

110 statcodes[statcodes == before] = after 

111 STATUS_CODES[func_name][after] = STATUS_CODES[func_name][before] 

112 

113 if numpy.any(statcodes < 0): 

114 # Errors present - only report the errors. 

115 if statcodes.shape: 

116 statcodes = statcodes[statcodes < 0] 

117 

118 errcodes = numpy.unique(statcodes) 

119 

120 errcounts = dict([(e, numpy.sum(statcodes == e)) for e in errcodes]) 

121 

122 elsemsg = STATUS_CODES[func_name].get('else', None) 

123 if elsemsg is None: 

124 errmsgs = dict([(e, STATUS_CODES[func_name].get( 

125 e, 'Return code ' + str(e))) for e in errcodes]) 

126 else: 

127 errmsgs = dict([(e, STATUS_CODES[func_name].get( 

128 e, elsemsg)) for e in errcodes]) 

129 

130 emsg = ', '.join(['{0} of "{1}"'.format(errcounts[e], errmsgs[e]) 

131 for e in errcodes]) 

132 raise ErfaError('ERFA function "{}" yielded {}' 

133 .format(func_name, emsg)) 

134 

135 elif numpy.any(statcodes > 0): 

136 # Only warnings present. 

137 if statcodes.shape: 

138 statcodes = statcodes[statcodes > 0] 

139 

140 warncodes = numpy.unique(statcodes) 

141 

142 warncounts = dict([(w, numpy.sum(statcodes == w)) for w in warncodes]) 

143 

144 elsemsg = STATUS_CODES[func_name].get('else', None) 

145 if elsemsg is None: 

146 warnmsgs = dict([(w, STATUS_CODES[func_name].get( 

147 w, 'Return code ' + str(w))) for w in warncodes]) 

148 else: 

149 warnmsgs = dict([(w, STATUS_CODES[func_name].get( 

150 w, elsemsg)) for w in warncodes]) 

151 

152 wmsg = ', '.join(['{0} of "{1}"'.format(warncounts[w], warnmsgs[w]) 

153 for w in warncodes]) 

154 warnings.warn('ERFA function "{}" yielded {}'.format(func_name, wmsg), 

155 ErfaWarning) 

156 

157 

158# <------------------------structured dtype conversion------------------------> 

159 

160dt_bytes1 = numpy.dtype('S1') 

161dt_bytes12 = numpy.dtype('S12') 

162 

163# <--------------------------Actual ERFA-wrapping code------------------------> 

164 

165 

166DPI = (3.141592653589793238462643) 

167"""Pi""" 

168D2PI = (6.283185307179586476925287) 

169"""2Pi""" 

170DR2D = (57.29577951308232087679815) 

171"""Radians to degrees""" 

172DD2R = (1.745329251994329576923691e-2) 

173"""Degrees to radians""" 

174DR2AS = (206264.8062470963551564734) 

175"""Radians to arcseconds""" 

176DAS2R = (4.848136811095359935899141e-6) 

177"""Arcseconds to radians""" 

178DS2R = (7.272205216643039903848712e-5) 

179"""Seconds of time to radians""" 

180TURNAS = (1296000.0) 

181"""Arcseconds in a full circle""" 

182DMAS2R = (DAS2R / 1e3) 

183"""Milliarcseconds to radians""" 

184DTY = (365.242198781) 

185"""Length of tropical year B1900 (days)""" 

186DAYSEC = (86400.0) 

187"""Seconds per day.""" 

188DJY = (365.25) 

189"""Days per Julian year""" 

190DJC = (36525.0) 

191"""Days per Julian century""" 

192DJM = (365250.0) 

193"""Days per Julian millennium""" 

194DJ00 = (2451545.0) 

195"""Reference epoch (J2000.0), Julian Date""" 

196DJM0 = (2400000.5) 

197"""Julian Date of Modified Julian Date zero""" 

198DJM00 = (51544.5) 

199"""Reference epoch (J2000.0), Modified Julian Date""" 

200DJM77 = (43144.0) 

201"""1977 Jan 1.0 as MJD""" 

202TTMTAI = (32.184) 

203"""TT minus TAI (s)""" 

204DAU = (149597870.7e3) 

205"""Astronomical unit (m, IAU 2012)""" 

206CMPS = 299792458.0 

207"""Speed of light (m/s)""" 

208AULT = (DAU/CMPS) 

209"""Light time for 1 au (s)""" 

210DC = (DAYSEC/AULT) 

211"""Speed of light (au per day)""" 

212ELG = (6.969290134e-10) 

213"""L_G = 1 - d(TT)/d(TCG)""" 

214ELB = (1.550519768e-8) 

215"""L_B = 1 - d(TDB)/d(TCB), and TDB (s) at TAI 1977/1/1.0""" 

216TDB0 = (-6.55e-5) 

217"""L_B = 1 - d(TDB)/d(TCB), and TDB (s) at TAI 1977/1/1.0""" 

218SRS = 1.97412574336e-8 

219"""Schwarzschild radius of the Sun (au) = 2 * 1.32712440041e20 / (2.99792458e8)^2 

220/ 1.49597870700e11""" 

221WGS84 = 1 

222"""Reference ellipsoids""" 

223GRS80 = 2 

224"""Reference ellipsoids""" 

225WGS72 = 3 

226"""Reference ellipsoids""" 

227 

228 

229def cal2jd(iy, im, id): 

230 """ 

231 Gregorian Calendar to Julian Date. 

232 

233 Parameters 

234 ---------- 

235 iy : int array 

236 im : int array 

237 id : int array 

238 

239 Returns 

240 ------- 

241 djm0 : double array 

242 djm : double array 

243 

244 Notes 

245 ----- 

246 Wraps ERFA function ``eraCal2jd``. The ERFA documentation is:: 

247 

248 - - - - - - - - - - 

249 e r a C a l 2 j d 

250 - - - - - - - - - - 

251 

252 Gregorian Calendar to Julian Date. 

253 

254 Given: 

255 iy,im,id int year, month, day in Gregorian calendar (Note 1) 

256 

257 Returned: 

258 djm0 double MJD zero-point: always 2400000.5 

259 djm double Modified Julian Date for 0 hrs 

260 

261 Returned (function value): 

262 int status: 

263 0 = OK 

264 -1 = bad year (Note 3: JD not computed) 

265 -2 = bad month (JD not computed) 

266 -3 = bad day (JD computed) 

267 

268 Notes: 

269 

270 1) The algorithm used is valid from -4800 March 1, but this 

271 implementation rejects dates before -4799 January 1. 

272 

273 2) The Julian Date is returned in two pieces, in the usual ERFA 

274 manner, which is designed to preserve time resolution. The 

275 Julian Date is available as a single number by adding djm0 and 

276 djm. 

277 

278 3) In early eras the conversion is from the "Proleptic Gregorian 

279 Calendar"; no account is taken of the date(s) of adoption of 

280 the Gregorian Calendar, nor is the AD/BC numbering convention 

281 observed. 

282 

283 Reference: 

284 

285 Explanatory Supplement to the Astronomical Almanac, 

286 P. Kenneth Seidelmann (ed), University Science Books (1992), 

287 Section 12.92 (p604). 

288 

289 This revision: 2021 May 11 

290 

291 Copyright (C) 2013-2021, NumFOCUS Foundation. 

292 Derived, with permission, from the SOFA library. See notes at end of file. 

293 

294 """ 

295 djm0, djm, c_retval = ufunc.cal2jd(iy, im, id) 

296 check_errwarn(c_retval, 'cal2jd') 

297 return djm0, djm 

298 

299 

300STATUS_CODES['cal2jd'] = { 

301 0: 'OK', 

302 -1: 'bad year (Note 3: JD not computed)', 

303 -2: 'bad month (JD not computed)', 

304 -3: 'bad day (JD computed)', 

305} 

306 

307 

308def epb(dj1, dj2): 

309 """ 

310 Julian Date to Besselian Epoch. 

311 

312 Parameters 

313 ---------- 

314 dj1 : double array 

315 dj2 : double array 

316 

317 Returns 

318 ------- 

319 c_retval : double array 

320 

321 Notes 

322 ----- 

323 Wraps ERFA function ``eraEpb``. The ERFA documentation is:: 

324 

325 - - - - - - - 

326 e r a E p b 

327 - - - - - - - 

328 

329 Julian Date to Besselian Epoch. 

330 

331 Given: 

332 dj1,dj2 double Julian Date (see note) 

333 

334 Returned (function value): 

335 double Besselian Epoch. 

336 

337 Note: 

338 

339 The Julian Date is supplied in two pieces, in the usual ERFA 

340 manner, which is designed to preserve time resolution. The 

341 Julian Date is available as a single number by adding dj1 and 

342 dj2. The maximum resolution is achieved if dj1 is 2451545.0 

343 (J2000.0). 

344 

345 Reference: 

346 

347 Lieske, J.H., 1979. Astron.Astrophys., 73, 282. 

348 

349 This revision: 2021 May 11 

350 

351 Copyright (C) 2013-2021, NumFOCUS Foundation. 

352 Derived, with permission, from the SOFA library. See notes at end of file. 

353 

354 """ 

355 c_retval = ufunc.epb(dj1, dj2) 

356 return c_retval 

357 

358 

359def epb2jd(epb): 

360 """ 

361 Besselian Epoch to Julian Date. 

362 

363 Parameters 

364 ---------- 

365 epb : double array 

366 

367 Returns 

368 ------- 

369 djm0 : double array 

370 djm : double array 

371 

372 Notes 

373 ----- 

374 Wraps ERFA function ``eraEpb2jd``. The ERFA documentation is:: 

375 

376 - - - - - - - - - - 

377 e r a E p b 2 j d 

378 - - - - - - - - - - 

379 

380 Besselian Epoch to Julian Date. 

381 

382 Given: 

383 epb double Besselian Epoch (e.g. 1957.3) 

384 

385 Returned: 

386 djm0 double MJD zero-point: always 2400000.5 

387 djm double Modified Julian Date 

388 

389 Note: 

390 

391 The Julian Date is returned in two pieces, in the usual ERFA 

392 manner, which is designed to preserve time resolution. The 

393 Julian Date is available as a single number by adding djm0 and 

394 djm. 

395 

396 Reference: 

397 

398 Lieske, J.H., 1979, Astron.Astrophys. 73, 282. 

399 

400 This revision: 2021 May 11 

401 

402 Copyright (C) 2013-2021, NumFOCUS Foundation. 

403 Derived, with permission, from the SOFA library. See notes at end of file. 

404 

405 """ 

406 djm0, djm = ufunc.epb2jd(epb) 

407 return djm0, djm 

408 

409 

410def epj(dj1, dj2): 

411 """ 

412 Julian Date to Julian Epoch. 

413 

414 Parameters 

415 ---------- 

416 dj1 : double array 

417 dj2 : double array 

418 

419 Returns 

420 ------- 

421 c_retval : double array 

422 

423 Notes 

424 ----- 

425 Wraps ERFA function ``eraEpj``. The ERFA documentation is:: 

426 

427 - - - - - - - 

428 e r a E p j 

429 - - - - - - - 

430 

431 Julian Date to Julian Epoch. 

432 

433 Given: 

434 dj1,dj2 double Julian Date (see note) 

435 

436 Returned (function value): 

437 double Julian Epoch 

438 

439 Note: 

440 

441 The Julian Date is supplied in two pieces, in the usual ERFA 

442 manner, which is designed to preserve time resolution. The 

443 Julian Date is available as a single number by adding dj1 and 

444 dj2. The maximum resolution is achieved if dj1 is 2451545.0 

445 (J2000.0). 

446 

447 Reference: 

448 

449 Lieske, J.H., 1979, Astron.Astrophys. 73, 282. 

450 

451 This revision: 2021 May 11 

452 

453 Copyright (C) 2013-2021, NumFOCUS Foundation. 

454 Derived, with permission, from the SOFA library. See notes at end of file. 

455 

456 """ 

457 c_retval = ufunc.epj(dj1, dj2) 

458 return c_retval 

459 

460 

461def epj2jd(epj): 

462 """ 

463 Julian Epoch to Julian Date. 

464 

465 Parameters 

466 ---------- 

467 epj : double array 

468 

469 Returns 

470 ------- 

471 djm0 : double array 

472 djm : double array 

473 

474 Notes 

475 ----- 

476 Wraps ERFA function ``eraEpj2jd``. The ERFA documentation is:: 

477 

478 - - - - - - - - - - 

479 e r a E p j 2 j d 

480 - - - - - - - - - - 

481 

482 Julian Epoch to Julian Date. 

483 

484 Given: 

485 epj double Julian Epoch (e.g. 1996.8) 

486 

487 Returned: 

488 djm0 double MJD zero-point: always 2400000.5 

489 djm double Modified Julian Date 

490 

491 Note: 

492 

493 The Julian Date is returned in two pieces, in the usual ERFA 

494 manner, which is designed to preserve time resolution. The 

495 Julian Date is available as a single number by adding djm0 and 

496 djm. 

497 

498 Reference: 

499 

500 Lieske, J.H., 1979, Astron.Astrophys. 73, 282. 

501 

502 This revision: 2021 May 11 

503 

504 Copyright (C) 2013-2021, NumFOCUS Foundation. 

505 Derived, with permission, from the SOFA library. See notes at end of file. 

506 

507 """ 

508 djm0, djm = ufunc.epj2jd(epj) 

509 return djm0, djm 

510 

511 

512def jd2cal(dj1, dj2): 

513 """ 

514 Julian Date to Gregorian year, month, day, and fraction of a day. 

515 

516 Parameters 

517 ---------- 

518 dj1 : double array 

519 dj2 : double array 

520 

521 Returns 

522 ------- 

523 iy : int array 

524 im : int array 

525 id : int array 

526 fd : double array 

527 

528 Notes 

529 ----- 

530 Wraps ERFA function ``eraJd2cal``. The ERFA documentation is:: 

531 

532 - - - - - - - - - - 

533 e r a J d 2 c a l 

534 - - - - - - - - - - 

535 

536 Julian Date to Gregorian year, month, day, and fraction of a day. 

537 

538 Given: 

539 dj1,dj2 double Julian Date (Notes 1, 2) 

540 

541 Returned (arguments): 

542 iy int year 

543 im int month 

544 id int day 

545 fd double fraction of day 

546 

547 Returned (function value): 

548 int status: 

549 0 = OK 

550 -1 = unacceptable date (Note 1) 

551 

552 Notes: 

553 

554 1) The earliest valid date is -68569.5 (-4900 March 1). The 

555 largest value accepted is 1e9. 

556 

557 2) The Julian Date is apportioned in any convenient way between 

558 the arguments dj1 and dj2. For example, JD=2450123.7 could 

559 be expressed in any of these ways, among others: 

560 

561 dj1 dj2 

562 

563 2450123.7 0.0 (JD method) 

564 2451545.0 -1421.3 (J2000 method) 

565 2400000.5 50123.2 (MJD method) 

566 2450123.5 0.2 (date & time method) 

567 

568 Separating integer and fraction uses the "compensated summation" 

569 algorithm of Kahan-Neumaier to preserve as much precision as 

570 possible irrespective of the jd1+jd2 apportionment. 

571 

572 3) In early eras the conversion is from the "proleptic Gregorian 

573 calendar"; no account is taken of the date(s) of adoption of 

574 the Gregorian calendar, nor is the AD/BC numbering convention 

575 observed. 

576 

577 References: 

578 

579 Explanatory Supplement to the Astronomical Almanac, 

580 P. Kenneth Seidelmann (ed), University Science Books (1992), 

581 Section 12.92 (p604). 

582 

583 Klein, A., A Generalized Kahan-Babuska-Summation-Algorithm. 

584 Computing, 76, 279-293 (2006), Section 3. 

585 

586 This revision: 2021 May 11 

587 

588 Copyright (C) 2013-2021, NumFOCUS Foundation. 

589 Derived, with permission, from the SOFA library. See notes at end of file. 

590 

591 """ 

592 iy, im, id, fd, c_retval = ufunc.jd2cal(dj1, dj2) 

593 check_errwarn(c_retval, 'jd2cal') 

594 return iy, im, id, fd 

595 

596 

597STATUS_CODES['jd2cal'] = { 

598 0: 'OK', 

599 -1: 'unacceptable date (Note 1)', 

600} 

601 

602 

603def jdcalf(ndp, dj1, dj2): 

604 """ 

605 Julian Date to Gregorian Calendar, expressed in a form convenient 

606 for formatting messages: rounded to a specified precision. 

607 

608 Parameters 

609 ---------- 

610 ndp : int array 

611 dj1 : double array 

612 dj2 : double array 

613 

614 Returns 

615 ------- 

616 iymdf : int array 

617 

618 Notes 

619 ----- 

620 Wraps ERFA function ``eraJdcalf``. The ERFA documentation is:: 

621 

622 - - - - - - - - - - 

623 e r a J d c a l f 

624 - - - - - - - - - - 

625 

626 Julian Date to Gregorian Calendar, expressed in a form convenient 

627 for formatting messages: rounded to a specified precision. 

628 

629 Given: 

630 ndp int number of decimal places of days in fraction 

631 dj1,dj2 double dj1+dj2 = Julian Date (Note 1) 

632 

633 Returned: 

634 iymdf int[4] year, month, day, fraction in Gregorian 

635 calendar 

636 

637 Returned (function value): 

638 int status: 

639 -1 = date out of range 

640 0 = OK 

641 +1 = NDP not 0-9 (interpreted as 0) 

642 

643 Notes: 

644 

645 1) The Julian Date is apportioned in any convenient way between 

646 the arguments dj1 and dj2. For example, JD=2450123.7 could 

647 be expressed in any of these ways, among others: 

648 

649 dj1 dj2 

650 

651 2450123.7 0.0 (JD method) 

652 2451545.0 -1421.3 (J2000 method) 

653 2400000.5 50123.2 (MJD method) 

654 2450123.5 0.2 (date & time method) 

655 

656 2) In early eras the conversion is from the "Proleptic Gregorian 

657 Calendar"; no account is taken of the date(s) of adoption of 

658 the Gregorian Calendar, nor is the AD/BC numbering convention 

659 observed. 

660 

661 3) See also the function eraJd2cal. 

662 

663 4) The number of decimal places ndp should be 4 or less if internal 

664 overflows are to be avoided on platforms which use 16-bit 

665 integers. 

666 

667 Called: 

668 eraJd2cal JD to Gregorian calendar 

669 

670 Reference: 

671 

672 Explanatory Supplement to the Astronomical Almanac, 

673 P. Kenneth Seidelmann (ed), University Science Books (1992), 

674 Section 12.92 (p604). 

675 

676 This revision: 2021 May 11 

677 

678 Copyright (C) 2013-2021, NumFOCUS Foundation. 

679 Derived, with permission, from the SOFA library. See notes at end of file. 

680 

681 """ 

682 iymdf, c_retval = ufunc.jdcalf(ndp, dj1, dj2) 

683 check_errwarn(c_retval, 'jdcalf') 

684 return iymdf 

685 

686 

687STATUS_CODES['jdcalf'] = { 

688 -1: 'date out of range', 

689 0: 'OK', 

690 1: 'NDP not 0-9 (interpreted as 0)', 

691} 

692 

693 

694def ab(pnat, v, s, bm1): 

695 """ 

696 Apply aberration to transform natural direction into proper 

697 direction. 

698 

699 Parameters 

700 ---------- 

701 pnat : double array 

702 v : double array 

703 s : double array 

704 bm1 : double array 

705 

706 Returns 

707 ------- 

708 ppr : double array 

709 

710 Notes 

711 ----- 

712 Wraps ERFA function ``eraAb``. The ERFA documentation is:: 

713 

714 - - - - - - 

715 e r a A b 

716 - - - - - - 

717 

718 Apply aberration to transform natural direction into proper 

719 direction. 

720 

721 Given: 

722 pnat double[3] natural direction to the source (unit vector) 

723 v double[3] observer barycentric velocity in units of c 

724 s double distance between the Sun and the observer (au) 

725 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

726 

727 Returned: 

728 ppr double[3] proper direction to source (unit vector) 

729 

730 Notes: 

731 

732 1) The algorithm is based on Expr. (7.40) in the Explanatory 

733 Supplement (Urban & Seidelmann 2013), but with the following 

734 changes: 

735 

736 o Rigorous rather than approximate normalization is applied. 

737 

738 o The gravitational potential term from Expr. (7) in 

739 Klioner (2003) is added, taking into account only the Sun's 

740 contribution. This has a maximum effect of about 

741 0.4 microarcsecond. 

742 

743 2) In almost all cases, the maximum accuracy will be limited by the 

744 supplied velocity. For example, if the ERFA eraEpv00 function is 

745 used, errors of up to 5 microarcseconds could occur. 

746 

747 References: 

748 

749 Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to 

750 the Astronomical Almanac, 3rd ed., University Science Books 

751 (2013). 

752 

753 Klioner, Sergei A., "A practical relativistic model for micro- 

754 arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003). 

755 

756 Called: 

757 eraPdp scalar product of two p-vectors 

758 

759 This revision: 2021 February 24 

760 

761 Copyright (C) 2013-2021, NumFOCUS Foundation. 

762 Derived, with permission, from the SOFA library. See notes at end of file. 

763 

764 """ 

765 ppr = ufunc.ab(pnat, v, s, bm1) 

766 return ppr 

767 

768 

769def apcg(date1, date2, ebpv, ehp): 

770 """ 

771 For a geocentric observer, prepare star-independent astrometry 

772 parameters for transformations between ICRS and GCRS coordinates. 

773 

774 Parameters 

775 ---------- 

776 date1 : double array 

777 date2 : double array 

778 ebpv : double array 

779 ehp : double array 

780 

781 Returns 

782 ------- 

783 astrom : eraASTROM array 

784 

785 Notes 

786 ----- 

787 Wraps ERFA function ``eraApcg``. The ERFA documentation is:: 

788 

789 - - - - - - - - 

790 e r a A p c g 

791 - - - - - - - - 

792 

793 For a geocentric observer, prepare star-independent astrometry 

794 parameters for transformations between ICRS and GCRS coordinates. 

795 The Earth ephemeris is supplied by the caller. 

796 

797 The parameters produced by this function are required in the 

798 parallax, light deflection and aberration parts of the astrometric 

799 transformation chain. 

800 

801 Given: 

802 date1 double TDB as a 2-part... 

803 date2 double ...Julian Date (Note 1) 

804 ebpv double[2][3] Earth barycentric pos/vel (au, au/day) 

805 ehp double[3] Earth heliocentric position (au) 

806 

807 Returned: 

808 astrom eraASTROM star-independent astrometry parameters: 

809 pmt double PM time interval (SSB, Julian years) 

810 eb double[3] SSB to observer (vector, au) 

811 eh double[3] Sun to observer (unit vector) 

812 em double distance from Sun to observer (au) 

813 v double[3] barycentric observer velocity (vector, c) 

814 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

815 bpn double[3][3] bias-precession-nutation matrix 

816 along double unchanged 

817 xpl double unchanged 

818 ypl double unchanged 

819 sphi double unchanged 

820 cphi double unchanged 

821 diurab double unchanged 

822 eral double unchanged 

823 refa double unchanged 

824 refb double unchanged 

825 

826 Notes: 

827 

828 1) The TDB date date1+date2 is a Julian Date, apportioned in any 

829 convenient way between the two arguments. For example, 

830 JD(TDB)=2450123.7 could be expressed in any of these ways, among 

831 others: 

832 

833 date1 date2 

834 

835 2450123.7 0.0 (JD method) 

836 2451545.0 -1421.3 (J2000 method) 

837 2400000.5 50123.2 (MJD method) 

838 2450123.5 0.2 (date & time method) 

839 

840 The JD method is the most natural and convenient to use in cases 

841 where the loss of several decimal digits of resolution is 

842 acceptable. The J2000 method is best matched to the way the 

843 argument is handled internally and will deliver the optimum 

844 resolution. The MJD method and the date & time methods are both 

845 good compromises between resolution and convenience. For most 

846 applications of this function the choice will not be at all 

847 critical. 

848 

849 TT can be used instead of TDB without any significant impact on 

850 accuracy. 

851 

852 2) All the vectors are with respect to BCRS axes. 

853 

854 3) This is one of several functions that inserts into the astrom 

855 structure star-independent parameters needed for the chain of 

856 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

857 

858 The various functions support different classes of observer and 

859 portions of the transformation chain: 

860 

861 functions observer transformation 

862 

863 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

864 eraApci eraApci13 terrestrial ICRS <-> CIRS 

865 eraApco eraApco13 terrestrial ICRS <-> observed 

866 eraApcs eraApcs13 space ICRS <-> GCRS 

867 eraAper eraAper13 terrestrial update Earth rotation 

868 eraApio eraApio13 terrestrial CIRS <-> observed 

869 

870 Those with names ending in "13" use contemporary ERFA models to 

871 compute the various ephemerides. The others accept ephemerides 

872 supplied by the caller. 

873 

874 The transformation from ICRS to GCRS covers space motion, 

875 parallax, light deflection, and aberration. From GCRS to CIRS 

876 comprises frame bias and precession-nutation. From CIRS to 

877 observed takes account of Earth rotation, polar motion, diurnal 

878 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

879 transformation), and atmospheric refraction. 

880 

881 4) The context structure astrom produced by this function is used by 

882 eraAtciq* and eraAticq*. 

883 

884 Called: 

885 eraApcs astrometry parameters, ICRS-GCRS, space observer 

886 

887 This revision: 2013 October 9 

888 

889 Copyright (C) 2013-2021, NumFOCUS Foundation. 

890 Derived, with permission, from the SOFA library. See notes at end of file. 

891 

892 """ 

893 astrom = ufunc.apcg(date1, date2, ebpv, ehp) 

894 return astrom 

895 

896 

897def apcg13(date1, date2): 

898 """ 

899 For a geocentric observer, prepare star-independent astrometry 

900 parameters for transformations between ICRS and GCRS coordinates. 

901 

902 Parameters 

903 ---------- 

904 date1 : double array 

905 date2 : double array 

906 

907 Returns 

908 ------- 

909 astrom : eraASTROM array 

910 

911 Notes 

912 ----- 

913 Wraps ERFA function ``eraApcg13``. The ERFA documentation is:: 

914 

915 - - - - - - - - - - 

916 e r a A p c g 1 3 

917 - - - - - - - - - - 

918 

919 For a geocentric observer, prepare star-independent astrometry 

920 parameters for transformations between ICRS and GCRS coordinates. 

921 The caller supplies the date, and ERFA models are used to predict 

922 the Earth ephemeris. 

923 

924 The parameters produced by this function are required in the 

925 parallax, light deflection and aberration parts of the astrometric 

926 transformation chain. 

927 

928 Given: 

929 date1 double TDB as a 2-part... 

930 date2 double ...Julian Date (Note 1) 

931 

932 Returned: 

933 astrom eraASTROM* star-independent astrometry parameters: 

934 pmt double PM time interval (SSB, Julian years) 

935 eb double[3] SSB to observer (vector, au) 

936 eh double[3] Sun to observer (unit vector) 

937 em double distance from Sun to observer (au) 

938 v double[3] barycentric observer velocity (vector, c) 

939 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

940 bpn double[3][3] bias-precession-nutation matrix 

941 along double unchanged 

942 xpl double unchanged 

943 ypl double unchanged 

944 sphi double unchanged 

945 cphi double unchanged 

946 diurab double unchanged 

947 eral double unchanged 

948 refa double unchanged 

949 refb double unchanged 

950 

951 Notes: 

952 

953 1) The TDB date date1+date2 is a Julian Date, apportioned in any 

954 convenient way between the two arguments. For example, 

955 JD(TDB)=2450123.7 could be expressed in any of these ways, among 

956 others: 

957 

958 date1 date2 

959 

960 2450123.7 0.0 (JD method) 

961 2451545.0 -1421.3 (J2000 method) 

962 2400000.5 50123.2 (MJD method) 

963 2450123.5 0.2 (date & time method) 

964 

965 The JD method is the most natural and convenient to use in cases 

966 where the loss of several decimal digits of resolution is 

967 acceptable. The J2000 method is best matched to the way the 

968 argument is handled internally and will deliver the optimum 

969 resolution. The MJD method and the date & time methods are both 

970 good compromises between resolution and convenience. For most 

971 applications of this function the choice will not be at all 

972 critical. 

973 

974 TT can be used instead of TDB without any significant impact on 

975 accuracy. 

976 

977 2) All the vectors are with respect to BCRS axes. 

978 

979 3) In cases where the caller wishes to supply his own Earth 

980 ephemeris, the function eraApcg can be used instead of the present 

981 function. 

982 

983 4) This is one of several functions that inserts into the astrom 

984 structure star-independent parameters needed for the chain of 

985 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

986 

987 The various functions support different classes of observer and 

988 portions of the transformation chain: 

989 

990 functions observer transformation 

991 

992 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

993 eraApci eraApci13 terrestrial ICRS <-> CIRS 

994 eraApco eraApco13 terrestrial ICRS <-> observed 

995 eraApcs eraApcs13 space ICRS <-> GCRS 

996 eraAper eraAper13 terrestrial update Earth rotation 

997 eraApio eraApio13 terrestrial CIRS <-> observed 

998 

999 Those with names ending in "13" use contemporary ERFA models to 

1000 compute the various ephemerides. The others accept ephemerides 

1001 supplied by the caller. 

1002 

1003 The transformation from ICRS to GCRS covers space motion, 

1004 parallax, light deflection, and aberration. From GCRS to CIRS 

1005 comprises frame bias and precession-nutation. From CIRS to 

1006 observed takes account of Earth rotation, polar motion, diurnal 

1007 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

1008 transformation), and atmospheric refraction. 

1009 

1010 5) The context structure astrom produced by this function is used by 

1011 eraAtciq* and eraAticq*. 

1012 

1013 Called: 

1014 eraEpv00 Earth position and velocity 

1015 eraApcg astrometry parameters, ICRS-GCRS, geocenter 

1016 

1017 This revision: 2013 October 9 

1018 

1019 Copyright (C) 2013-2021, NumFOCUS Foundation. 

1020 Derived, with permission, from the SOFA library. See notes at end of file. 

1021 

1022 """ 

1023 astrom = ufunc.apcg13(date1, date2) 

1024 return astrom 

1025 

1026 

1027def apci(date1, date2, ebpv, ehp, x, y, s): 

1028 """ 

1029 For a terrestrial observer, prepare star-independent astrometry 

1030 parameters for transformations between ICRS and geocentric CIRS 

1031 coordinates. 

1032 

1033 Parameters 

1034 ---------- 

1035 date1 : double array 

1036 date2 : double array 

1037 ebpv : double array 

1038 ehp : double array 

1039 x : double array 

1040 y : double array 

1041 s : double array 

1042 

1043 Returns 

1044 ------- 

1045 astrom : eraASTROM array 

1046 

1047 Notes 

1048 ----- 

1049 Wraps ERFA function ``eraApci``. The ERFA documentation is:: 

1050 

1051 - - - - - - - - 

1052 e r a A p c i 

1053 - - - - - - - - 

1054 

1055 For a terrestrial observer, prepare star-independent astrometry 

1056 parameters for transformations between ICRS and geocentric CIRS 

1057 coordinates. The Earth ephemeris and CIP/CIO are supplied by the 

1058 caller. 

1059 

1060 The parameters produced by this function are required in the 

1061 parallax, light deflection, aberration, and bias-precession-nutation 

1062 parts of the astrometric transformation chain. 

1063 

1064 Given: 

1065 date1 double TDB as a 2-part... 

1066 date2 double ...Julian Date (Note 1) 

1067 ebpv double[2][3] Earth barycentric position/velocity (au, au/day) 

1068 ehp double[3] Earth heliocentric position (au) 

1069 x,y double CIP X,Y (components of unit vector) 

1070 s double the CIO locator s (radians) 

1071 

1072 Returned: 

1073 astrom eraASTROM star-independent astrometry parameters: 

1074 pmt double PM time interval (SSB, Julian years) 

1075 eb double[3] SSB to observer (vector, au) 

1076 eh double[3] Sun to observer (unit vector) 

1077 em double distance from Sun to observer (au) 

1078 v double[3] barycentric observer velocity (vector, c) 

1079 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

1080 bpn double[3][3] bias-precession-nutation matrix 

1081 along double unchanged 

1082 xpl double unchanged 

1083 ypl double unchanged 

1084 sphi double unchanged 

1085 cphi double unchanged 

1086 diurab double unchanged 

1087 eral double unchanged 

1088 refa double unchanged 

1089 refb double unchanged 

1090 

1091 Notes: 

1092 

1093 1) The TDB date date1+date2 is a Julian Date, apportioned in any 

1094 convenient way between the two arguments. For example, 

1095 JD(TDB)=2450123.7 could be expressed in any of these ways, among 

1096 others: 

1097 

1098 date1 date2 

1099 

1100 2450123.7 0.0 (JD method) 

1101 2451545.0 -1421.3 (J2000 method) 

1102 2400000.5 50123.2 (MJD method) 

1103 2450123.5 0.2 (date & time method) 

1104 

1105 The JD method is the most natural and convenient to use in cases 

1106 where the loss of several decimal digits of resolution is 

1107 acceptable. The J2000 method is best matched to the way the 

1108 argument is handled internally and will deliver the optimum 

1109 resolution. The MJD method and the date & time methods are both 

1110 good compromises between resolution and convenience. For most 

1111 applications of this function the choice will not be at all 

1112 critical. 

1113 

1114 TT can be used instead of TDB without any significant impact on 

1115 accuracy. 

1116 

1117 2) All the vectors are with respect to BCRS axes. 

1118 

1119 3) In cases where the caller does not wish to provide the Earth 

1120 ephemeris and CIP/CIO, the function eraApci13 can be used instead 

1121 of the present function. This computes the required quantities 

1122 using other ERFA functions. 

1123 

1124 4) This is one of several functions that inserts into the astrom 

1125 structure star-independent parameters needed for the chain of 

1126 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

1127 

1128 The various functions support different classes of observer and 

1129 portions of the transformation chain: 

1130 

1131 functions observer transformation 

1132 

1133 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

1134 eraApci eraApci13 terrestrial ICRS <-> CIRS 

1135 eraApco eraApco13 terrestrial ICRS <-> observed 

1136 eraApcs eraApcs13 space ICRS <-> GCRS 

1137 eraAper eraAper13 terrestrial update Earth rotation 

1138 eraApio eraApio13 terrestrial CIRS <-> observed 

1139 

1140 Those with names ending in "13" use contemporary ERFA models to 

1141 compute the various ephemerides. The others accept ephemerides 

1142 supplied by the caller. 

1143 

1144 The transformation from ICRS to GCRS covers space motion, 

1145 parallax, light deflection, and aberration. From GCRS to CIRS 

1146 comprises frame bias and precession-nutation. From CIRS to 

1147 observed takes account of Earth rotation, polar motion, diurnal 

1148 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

1149 transformation), and atmospheric refraction. 

1150 

1151 5) The context structure astrom produced by this function is used by 

1152 eraAtciq* and eraAticq*. 

1153 

1154 Called: 

1155 eraApcg astrometry parameters, ICRS-GCRS, geocenter 

1156 eraC2ixys celestial-to-intermediate matrix, given X,Y and s 

1157 

1158 This revision: 2013 September 25 

1159 

1160 Copyright (C) 2013-2021, NumFOCUS Foundation. 

1161 Derived, with permission, from the SOFA library. See notes at end of file. 

1162 

1163 """ 

1164 astrom = ufunc.apci(date1, date2, ebpv, ehp, x, y, s) 

1165 return astrom 

1166 

1167 

1168def apci13(date1, date2): 

1169 """ 

1170 For a terrestrial observer, prepare star-independent astrometry 

1171 parameters for transformations between ICRS and geocentric CIRS 

1172 coordinates. 

1173 

1174 Parameters 

1175 ---------- 

1176 date1 : double array 

1177 date2 : double array 

1178 

1179 Returns 

1180 ------- 

1181 astrom : eraASTROM array 

1182 eo : double array 

1183 

1184 Notes 

1185 ----- 

1186 Wraps ERFA function ``eraApci13``. The ERFA documentation is:: 

1187 

1188 - - - - - - - - - - 

1189 e r a A p c i 1 3 

1190 - - - - - - - - - - 

1191 

1192 For a terrestrial observer, prepare star-independent astrometry 

1193 parameters for transformations between ICRS and geocentric CIRS 

1194 coordinates. The caller supplies the date, and ERFA models are used 

1195 to predict the Earth ephemeris and CIP/CIO. 

1196 

1197 The parameters produced by this function are required in the 

1198 parallax, light deflection, aberration, and bias-precession-nutation 

1199 parts of the astrometric transformation chain. 

1200 

1201 Given: 

1202 date1 double TDB as a 2-part... 

1203 date2 double ...Julian Date (Note 1) 

1204 

1205 Returned: 

1206 astrom eraASTROM star-independent astrometry parameters: 

1207 pmt double PM time interval (SSB, Julian years) 

1208 eb double[3] SSB to observer (vector, au) 

1209 eh double[3] Sun to observer (unit vector) 

1210 em double distance from Sun to observer (au) 

1211 v double[3] barycentric observer velocity (vector, c) 

1212 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

1213 bpn double[3][3] bias-precession-nutation matrix 

1214 along double unchanged 

1215 xpl double unchanged 

1216 ypl double unchanged 

1217 sphi double unchanged 

1218 cphi double unchanged 

1219 diurab double unchanged 

1220 eral double unchanged 

1221 refa double unchanged 

1222 refb double unchanged 

1223 eo double equation of the origins (ERA-GST) 

1224 

1225 Notes: 

1226 

1227 1) The TDB date date1+date2 is a Julian Date, apportioned in any 

1228 convenient way between the two arguments. For example, 

1229 JD(TDB)=2450123.7 could be expressed in any of these ways, among 

1230 others: 

1231 

1232 date1 date2 

1233 

1234 2450123.7 0.0 (JD method) 

1235 2451545.0 -1421.3 (J2000 method) 

1236 2400000.5 50123.2 (MJD method) 

1237 2450123.5 0.2 (date & time method) 

1238 

1239 The JD method is the most natural and convenient to use in cases 

1240 where the loss of several decimal digits of resolution is 

1241 acceptable. The J2000 method is best matched to the way the 

1242 argument is handled internally and will deliver the optimum 

1243 resolution. The MJD method and the date & time methods are both 

1244 good compromises between resolution and convenience. For most 

1245 applications of this function the choice will not be at all 

1246 critical. 

1247 

1248 TT can be used instead of TDB without any significant impact on 

1249 accuracy. 

1250 

1251 2) All the vectors are with respect to BCRS axes. 

1252 

1253 3) In cases where the caller wishes to supply his own Earth 

1254 ephemeris and CIP/CIO, the function eraApci can be used instead 

1255 of the present function. 

1256 

1257 4) This is one of several functions that inserts into the astrom 

1258 structure star-independent parameters needed for the chain of 

1259 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

1260 

1261 The various functions support different classes of observer and 

1262 portions of the transformation chain: 

1263 

1264 functions observer transformation 

1265 

1266 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

1267 eraApci eraApci13 terrestrial ICRS <-> CIRS 

1268 eraApco eraApco13 terrestrial ICRS <-> observed 

1269 eraApcs eraApcs13 space ICRS <-> GCRS 

1270 eraAper eraAper13 terrestrial update Earth rotation 

1271 eraApio eraApio13 terrestrial CIRS <-> observed 

1272 

1273 Those with names ending in "13" use contemporary ERFA models to 

1274 compute the various ephemerides. The others accept ephemerides 

1275 supplied by the caller. 

1276 

1277 The transformation from ICRS to GCRS covers space motion, 

1278 parallax, light deflection, and aberration. From GCRS to CIRS 

1279 comprises frame bias and precession-nutation. From CIRS to 

1280 observed takes account of Earth rotation, polar motion, diurnal 

1281 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

1282 transformation), and atmospheric refraction. 

1283 

1284 5) The context structure astrom produced by this function is used by 

1285 eraAtciq* and eraAticq*. 

1286 

1287 Called: 

1288 eraEpv00 Earth position and velocity 

1289 eraPnm06a classical NPB matrix, IAU 2006/2000A 

1290 eraBpn2xy extract CIP X,Y coordinates from NPB matrix 

1291 eraS06 the CIO locator s, given X,Y, IAU 2006 

1292 eraApci astrometry parameters, ICRS-CIRS 

1293 eraEors equation of the origins, given NPB matrix and s 

1294 

1295 This revision: 2013 October 9 

1296 

1297 Copyright (C) 2013-2021, NumFOCUS Foundation. 

1298 Derived, with permission, from the SOFA library. See notes at end of file. 

1299 

1300 """ 

1301 astrom, eo = ufunc.apci13(date1, date2) 

1302 return astrom, eo 

1303 

1304 

1305def apco(date1, date2, ebpv, ehp, x, y, s, theta, elong, phi, hm, xp, yp, sp, refa, refb): 

1306 """ 

1307 For a terrestrial observer, prepare star-independent astrometry 

1308 parameters for transformations between ICRS and observed 

1309 coordinates. 

1310 

1311 Parameters 

1312 ---------- 

1313 date1 : double array 

1314 date2 : double array 

1315 ebpv : double array 

1316 ehp : double array 

1317 x : double array 

1318 y : double array 

1319 s : double array 

1320 theta : double array 

1321 elong : double array 

1322 phi : double array 

1323 hm : double array 

1324 xp : double array 

1325 yp : double array 

1326 sp : double array 

1327 refa : double array 

1328 refb : double array 

1329 

1330 Returns 

1331 ------- 

1332 astrom : eraASTROM array 

1333 

1334 Notes 

1335 ----- 

1336 Wraps ERFA function ``eraApco``. The ERFA documentation is:: 

1337 

1338 - - - - - - - - 

1339 e r a A p c o 

1340 - - - - - - - - 

1341 

1342 For a terrestrial observer, prepare star-independent astrometry 

1343 parameters for transformations between ICRS and observed 

1344 coordinates. The caller supplies the Earth ephemeris, the Earth 

1345 rotation information and the refraction constants as well as the 

1346 site coordinates. 

1347 

1348 Given: 

1349 date1 double TDB as a 2-part... 

1350 date2 double ...Julian Date (Note 1) 

1351 ebpv double[2][3] Earth barycentric PV (au, au/day, Note 2) 

1352 ehp double[3] Earth heliocentric P (au, Note 2) 

1353 x,y double CIP X,Y (components of unit vector) 

1354 s double the CIO locator s (radians) 

1355 theta double Earth rotation angle (radians) 

1356 elong double longitude (radians, east +ve, Note 3) 

1357 phi double latitude (geodetic, radians, Note 3) 

1358 hm double height above ellipsoid (m, geodetic, Note 3) 

1359 xp,yp double polar motion coordinates (radians, Note 4) 

1360 sp double the TIO locator s' (radians, Note 4) 

1361 refa double refraction constant A (radians, Note 5) 

1362 refb double refraction constant B (radians, Note 5) 

1363 

1364 Returned: 

1365 astrom eraASTROM star-independent astrometry parameters: 

1366 pmt double PM time interval (SSB, Julian years) 

1367 eb double[3] SSB to observer (vector, au) 

1368 eh double[3] Sun to observer (unit vector) 

1369 em double distance from Sun to observer (au) 

1370 v double[3] barycentric observer velocity (vector, c) 

1371 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

1372 bpn double[3][3] bias-precession-nutation matrix 

1373 along double adjusted longitude (radians) 

1374 xpl double polar motion xp wrt local meridian (radians) 

1375 ypl double polar motion yp wrt local meridian (radians) 

1376 sphi double sine of geodetic latitude 

1377 cphi double cosine of geodetic latitude 

1378 diurab double magnitude of diurnal aberration vector 

1379 eral double "local" Earth rotation angle (radians) 

1380 refa double refraction constant A (radians) 

1381 refb double refraction constant B (radians) 

1382 

1383 Notes: 

1384 

1385 1) The TDB date date1+date2 is a Julian Date, apportioned in any 

1386 convenient way between the two arguments. For example, 

1387 JD(TDB)=2450123.7 could be expressed in any of these ways, among 

1388 others: 

1389 

1390 date1 date2 

1391 

1392 2450123.7 0.0 (JD method) 

1393 2451545.0 -1421.3 (J2000 method) 

1394 2400000.5 50123.2 (MJD method) 

1395 2450123.5 0.2 (date & time method) 

1396 

1397 The JD method is the most natural and convenient to use in cases 

1398 where the loss of several decimal digits of resolution is 

1399 acceptable. The J2000 method is best matched to the way the 

1400 argument is handled internally and will deliver the optimum 

1401 resolution. The MJD method and the date & time methods are both 

1402 good compromises between resolution and convenience. For most 

1403 applications of this function the choice will not be at all 

1404 critical. 

1405 

1406 TT can be used instead of TDB without any significant impact on 

1407 accuracy. 

1408 

1409 2) The vectors eb, eh, and all the astrom vectors, are with respect 

1410 to BCRS axes. 

1411 

1412 3) The geographical coordinates are with respect to the ERFA_WGS84 

1413 reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN 

1414 CONVENTION: the longitude required by the present function is 

1415 right-handed, i.e. east-positive, in accordance with geographical 

1416 convention. 

1417 

1418 The adjusted longitude stored in the astrom array takes into 

1419 account the TIO locator and polar motion. 

1420 

1421 4) xp and yp are the coordinates (in radians) of the Celestial 

1422 Intermediate Pole with respect to the International Terrestrial 

1423 Reference System (see IERS Conventions), measured along the 

1424 meridians 0 and 90 deg west respectively. sp is the TIO locator 

1425 s', in radians, which positions the Terrestrial Intermediate 

1426 Origin on the equator. For many applications, xp, yp and 

1427 (especially) sp can be set to zero. 

1428 

1429 Internally, the polar motion is stored in a form rotated onto the 

1430 local meridian. 

1431 

1432 5) The refraction constants refa and refb are for use in a 

1433 dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed 

1434 (i.e. refracted) zenith distance and dZ is the amount of 

1435 refraction. 

1436 

1437 6) It is advisable to take great care with units, as even unlikely 

1438 values of the input parameters are accepted and processed in 

1439 accordance with the models used. 

1440 

1441 7) In cases where the caller does not wish to provide the Earth 

1442 Ephemeris, the Earth rotation information and refraction 

1443 constants, the function eraApco13 can be used instead of the 

1444 present function. This starts from UTC and weather readings etc. 

1445 and computes suitable values using other ERFA functions. 

1446 

1447 8) This is one of several functions that inserts into the astrom 

1448 structure star-independent parameters needed for the chain of 

1449 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

1450 

1451 The various functions support different classes of observer and 

1452 portions of the transformation chain: 

1453 

1454 functions observer transformation 

1455 

1456 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

1457 eraApci eraApci13 terrestrial ICRS <-> CIRS 

1458 eraApco eraApco13 terrestrial ICRS <-> observed 

1459 eraApcs eraApcs13 space ICRS <-> GCRS 

1460 eraAper eraAper13 terrestrial update Earth rotation 

1461 eraApio eraApio13 terrestrial CIRS <-> observed 

1462 

1463 Those with names ending in "13" use contemporary ERFA models to 

1464 compute the various ephemerides. The others accept ephemerides 

1465 supplied by the caller. 

1466 

1467 The transformation from ICRS to GCRS covers space motion, 

1468 parallax, light deflection, and aberration. From GCRS to CIRS 

1469 comprises frame bias and precession-nutation. From CIRS to 

1470 observed takes account of Earth rotation, polar motion, diurnal 

1471 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

1472 transformation), and atmospheric refraction. 

1473 

1474 9) The context structure astrom produced by this function is used by 

1475 eraAtioq, eraAtoiq, eraAtciq* and eraAticq*. 

1476 

1477 Called: 

1478 eraIr initialize r-matrix to identity 

1479 eraRz rotate around Z-axis 

1480 eraRy rotate around Y-axis 

1481 eraRx rotate around X-axis 

1482 eraAnpm normalize angle into range +/- pi 

1483 eraC2ixys celestial-to-intermediate matrix, given X,Y and s 

1484 eraPvtob position/velocity of terrestrial station 

1485 eraTrxpv product of transpose of r-matrix and pv-vector 

1486 eraApcs astrometry parameters, ICRS-GCRS, space observer 

1487 eraCr copy r-matrix 

1488 

1489 This revision: 2021 February 24 

1490 

1491 Copyright (C) 2013-2021, NumFOCUS Foundation. 

1492 Derived, with permission, from the SOFA library. See notes at end of file. 

1493 

1494 """ 

1495 astrom = ufunc.apco( 

1496 date1, date2, ebpv, ehp, x, y, s, theta, elong, phi, hm, xp, yp, sp, refa, refb) 

1497 return astrom 

1498 

1499 

1500def apco13(utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl): 

1501 """ 

1502 For a terrestrial observer, prepare star-independent astrometry 

1503 parameters for transformations between ICRS and observed 

1504 coordinates. 

1505 

1506 Parameters 

1507 ---------- 

1508 utc1 : double array 

1509 utc2 : double array 

1510 dut1 : double array 

1511 elong : double array 

1512 phi : double array 

1513 hm : double array 

1514 xp : double array 

1515 yp : double array 

1516 phpa : double array 

1517 tc : double array 

1518 rh : double array 

1519 wl : double array 

1520 

1521 Returns 

1522 ------- 

1523 astrom : eraASTROM array 

1524 eo : double array 

1525 

1526 Notes 

1527 ----- 

1528 Wraps ERFA function ``eraApco13``. The ERFA documentation is:: 

1529 

1530 - - - - - - - - - - 

1531 e r a A p c o 1 3 

1532 - - - - - - - - - - 

1533 

1534 For a terrestrial observer, prepare star-independent astrometry 

1535 parameters for transformations between ICRS and observed 

1536 coordinates. The caller supplies UTC, site coordinates, ambient air 

1537 conditions and observing wavelength, and ERFA models are used to 

1538 obtain the Earth ephemeris, CIP/CIO and refraction constants. 

1539 

1540 The parameters produced by this function are required in the 

1541 parallax, light deflection, aberration, and bias-precession-nutation 

1542 parts of the ICRS/CIRS transformations. 

1543 

1544 Given: 

1545 utc1 double UTC as a 2-part... 

1546 utc2 double ...quasi Julian Date (Notes 1,2) 

1547 dut1 double UT1-UTC (seconds, Note 3) 

1548 elong double longitude (radians, east +ve, Note 4) 

1549 phi double latitude (geodetic, radians, Note 4) 

1550 hm double height above ellipsoid (m, geodetic, Notes 4,6) 

1551 xp,yp double polar motion coordinates (radians, Note 5) 

1552 phpa double pressure at the observer (hPa = mB, Note 6) 

1553 tc double ambient temperature at the observer (deg C) 

1554 rh double relative humidity at the observer (range 0-1) 

1555 wl double wavelength (micrometers, Note 7) 

1556 

1557 Returned: 

1558 astrom eraASTROM* star-independent astrometry parameters: 

1559 pmt double PM time interval (SSB, Julian years) 

1560 eb double[3] SSB to observer (vector, au) 

1561 eh double[3] Sun to observer (unit vector) 

1562 em double distance from Sun to observer (au) 

1563 v double[3] barycentric observer velocity (vector, c) 

1564 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

1565 bpn double[3][3] bias-precession-nutation matrix 

1566 along double longitude + s' (radians) 

1567 xpl double polar motion xp wrt local meridian (radians) 

1568 ypl double polar motion yp wrt local meridian (radians) 

1569 sphi double sine of geodetic latitude 

1570 cphi double cosine of geodetic latitude 

1571 diurab double magnitude of diurnal aberration vector 

1572 eral double "local" Earth rotation angle (radians) 

1573 refa double refraction constant A (radians) 

1574 refb double refraction constant B (radians) 

1575 eo double equation of the origins (ERA-GST) 

1576 

1577 Returned (function value): 

1578 int status: +1 = dubious year (Note 2) 

1579 0 = OK 

1580 -1 = unacceptable date 

1581 

1582 Notes: 

1583 

1584 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any 

1585 convenient way between the two arguments, for example where utc1 

1586 is the Julian Day Number and utc2 is the fraction of a day. 

1587 

1588 However, JD cannot unambiguously represent UTC during a leap 

1589 second unless special measures are taken. The convention in the 

1590 present function is that the JD day represents UTC days whether 

1591 the length is 86399, 86400 or 86401 SI seconds. 

1592 

1593 Applications should use the function eraDtf2d to convert from 

1594 calendar date and time of day into 2-part quasi Julian Date, as 

1595 it implements the leap-second-ambiguity convention just 

1596 described. 

1597 

1598 2) The warning status "dubious year" flags UTCs that predate the 

1599 introduction of the time scale or that are too far in the 

1600 future to be trusted. See eraDat for further details. 

1601 

1602 3) UT1-UTC is tabulated in IERS bulletins. It increases by exactly 

1603 one second at the end of each positive UTC leap second, 

1604 introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This 

1605 practice is under review, and in the future UT1-UTC may grow 

1606 essentially without limit. 

1607 

1608 4) The geographical coordinates are with respect to the ERFA_WGS84 

1609 reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the 

1610 longitude required by the present function is east-positive 

1611 (i.e. right-handed), in accordance with geographical convention. 

1612 

1613 5) The polar motion xp,yp can be obtained from IERS bulletins. The 

1614 values are the coordinates (in radians) of the Celestial 

1615 Intermediate Pole with respect to the International Terrestrial 

1616 Reference System (see IERS Conventions 2003), measured along the 

1617 meridians 0 and 90 deg west respectively. For many 

1618 applications, xp and yp can be set to zero. 

1619 

1620 Internally, the polar motion is stored in a form rotated onto 

1621 the local meridian. 

1622 

1623 6) If hm, the height above the ellipsoid of the observing station 

1624 in meters, is not known but phpa, the pressure in hPa (=mB), is 

1625 available, an adequate estimate of hm can be obtained from the 

1626 expression 

1627 

1628 hm = -29.3 * tsl * log ( phpa / 1013.25 ); 

1629 

1630 where tsl is the approximate sea-level air temperature in K 

1631 (See Astrophysical Quantities, C.W.Allen, 3rd edition, section 

1632 52). Similarly, if the pressure phpa is not known, it can be 

1633 estimated from the height of the observing station, hm, as 

1634 follows: 

1635 

1636 phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); 

1637 

1638 Note, however, that the refraction is nearly proportional to 

1639 the pressure and that an accurate phpa value is important for 

1640 precise work. 

1641 

1642 7) The argument wl specifies the observing wavelength in 

1643 micrometers. The transition from optical to radio is assumed to 

1644 occur at 100 micrometers (about 3000 GHz). 

1645 

1646 8) It is advisable to take great care with units, as even unlikely 

1647 values of the input parameters are accepted and processed in 

1648 accordance with the models used. 

1649 

1650 9) In cases where the caller wishes to supply his own Earth 

1651 ephemeris, Earth rotation information and refraction constants, 

1652 the function eraApco can be used instead of the present function. 

1653 

1654 10) This is one of several functions that inserts into the astrom 

1655 structure star-independent parameters needed for the chain of 

1656 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

1657 

1658 The various functions support different classes of observer and 

1659 portions of the transformation chain: 

1660 

1661 functions observer transformation 

1662 

1663 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

1664 eraApci eraApci13 terrestrial ICRS <-> CIRS 

1665 eraApco eraApco13 terrestrial ICRS <-> observed 

1666 eraApcs eraApcs13 space ICRS <-> GCRS 

1667 eraAper eraAper13 terrestrial update Earth rotation 

1668 eraApio eraApio13 terrestrial CIRS <-> observed 

1669 

1670 Those with names ending in "13" use contemporary ERFA models to 

1671 compute the various ephemerides. The others accept ephemerides 

1672 supplied by the caller. 

1673 

1674 The transformation from ICRS to GCRS covers space motion, 

1675 parallax, light deflection, and aberration. From GCRS to CIRS 

1676 comprises frame bias and precession-nutation. From CIRS to 

1677 observed takes account of Earth rotation, polar motion, diurnal 

1678 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

1679 transformation), and atmospheric refraction. 

1680 

1681 11) The context structure astrom produced by this function is used 

1682 by eraAtioq, eraAtoiq, eraAtciq* and eraAticq*. 

1683 

1684 Called: 

1685 eraUtctai UTC to TAI 

1686 eraTaitt TAI to TT 

1687 eraUtcut1 UTC to UT1 

1688 eraEpv00 Earth position and velocity 

1689 eraPnm06a classical NPB matrix, IAU 2006/2000A 

1690 eraBpn2xy extract CIP X,Y coordinates from NPB matrix 

1691 eraS06 the CIO locator s, given X,Y, IAU 2006 

1692 eraEra00 Earth rotation angle, IAU 2000 

1693 eraSp00 the TIO locator s', IERS 2000 

1694 eraRefco refraction constants for given ambient conditions 

1695 eraApco astrometry parameters, ICRS-observed 

1696 eraEors equation of the origins, given NPB matrix and s 

1697 

1698 This revision: 2021 February 24 

1699 

1700 Copyright (C) 2013-2021, NumFOCUS Foundation. 

1701 Derived, with permission, from the SOFA library. See notes at end of file. 

1702 

1703 """ 

1704 astrom, eo, c_retval = ufunc.apco13( 

1705 utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) 

1706 check_errwarn(c_retval, 'apco13') 

1707 return astrom, eo 

1708 

1709 

1710STATUS_CODES['apco13'] = { 

1711 1: 'dubious year (Note 2)', 

1712 0: 'OK', 

1713 -1: 'unacceptable date', 

1714} 

1715 

1716 

1717def apcs(date1, date2, pv, ebpv, ehp): 

1718 """ 

1719 For an observer whose geocentric position and velocity are known, 

1720 prepare star-independent astrometry parameters for transformations 

1721 between ICRS and GCRS. 

1722 

1723 Parameters 

1724 ---------- 

1725 date1 : double array 

1726 date2 : double array 

1727 pv : double array 

1728 ebpv : double array 

1729 ehp : double array 

1730 

1731 Returns 

1732 ------- 

1733 astrom : eraASTROM array 

1734 

1735 Notes 

1736 ----- 

1737 Wraps ERFA function ``eraApcs``. The ERFA documentation is:: 

1738 

1739 - - - - - - - - 

1740 e r a A p c s 

1741 - - - - - - - - 

1742 

1743 For an observer whose geocentric position and velocity are known, 

1744 prepare star-independent astrometry parameters for transformations 

1745 between ICRS and GCRS. The Earth ephemeris is supplied by the 

1746 caller. 

1747 

1748 The parameters produced by this function are required in the space 

1749 motion, parallax, light deflection and aberration parts of the 

1750 astrometric transformation chain. 

1751 

1752 Given: 

1753 date1 double TDB as a 2-part... 

1754 date2 double ...Julian Date (Note 1) 

1755 pv double[2][3] observer's geocentric pos/vel (m, m/s) 

1756 ebpv double[2][3] Earth barycentric PV (au, au/day) 

1757 ehp double[3] Earth heliocentric P (au) 

1758 

1759 Returned: 

1760 astrom eraASTROM star-independent astrometry parameters: 

1761 pmt double PM time interval (SSB, Julian years) 

1762 eb double[3] SSB to observer (vector, au) 

1763 eh double[3] Sun to observer (unit vector) 

1764 em double distance from Sun to observer (au) 

1765 v double[3] barycentric observer velocity (vector, c) 

1766 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

1767 bpn double[3][3] bias-precession-nutation matrix 

1768 along double unchanged 

1769 xpl double unchanged 

1770 ypl double unchanged 

1771 sphi double unchanged 

1772 cphi double unchanged 

1773 diurab double unchanged 

1774 eral double unchanged 

1775 refa double unchanged 

1776 refb double unchanged 

1777 

1778 Notes: 

1779 

1780 1) The TDB date date1+date2 is a Julian Date, apportioned in any 

1781 convenient way between the two arguments. For example, 

1782 JD(TDB)=2450123.7 could be expressed in any of these ways, among 

1783 others: 

1784 

1785 date1 date2 

1786 

1787 2450123.7 0.0 (JD method) 

1788 2451545.0 -1421.3 (J2000 method) 

1789 2400000.5 50123.2 (MJD method) 

1790 2450123.5 0.2 (date & time method) 

1791 

1792 The JD method is the most natural and convenient to use in cases 

1793 where the loss of several decimal digits of resolution is 

1794 acceptable. The J2000 method is best matched to the way the 

1795 argument is handled internally and will deliver the optimum 

1796 resolution. The MJD method and the date & time methods are both 

1797 good compromises between resolution and convenience. For most 

1798 applications of this function the choice will not be at all 

1799 critical. 

1800 

1801 TT can be used instead of TDB without any significant impact on 

1802 accuracy. 

1803 

1804 2) All the vectors are with respect to BCRS axes. 

1805 

1806 3) Providing separate arguments for (i) the observer's geocentric 

1807 position and velocity and (ii) the Earth ephemeris is done for 

1808 convenience in the geocentric, terrestrial and Earth orbit cases. 

1809 For deep space applications it maybe more convenient to specify 

1810 zero geocentric position and velocity and to supply the 

1811 observer's position and velocity information directly instead of 

1812 with respect to the Earth. However, note the different units: 

1813 m and m/s for the geocentric vectors, au and au/day for the 

1814 heliocentric and barycentric vectors. 

1815 

1816 4) In cases where the caller does not wish to provide the Earth 

1817 ephemeris, the function eraApcs13 can be used instead of the 

1818 present function. This computes the Earth ephemeris using the 

1819 ERFA function eraEpv00. 

1820 

1821 5) This is one of several functions that inserts into the astrom 

1822 structure star-independent parameters needed for the chain of 

1823 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

1824 

1825 The various functions support different classes of observer and 

1826 portions of the transformation chain: 

1827 

1828 functions observer transformation 

1829 

1830 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

1831 eraApci eraApci13 terrestrial ICRS <-> CIRS 

1832 eraApco eraApco13 terrestrial ICRS <-> observed 

1833 eraApcs eraApcs13 space ICRS <-> GCRS 

1834 eraAper eraAper13 terrestrial update Earth rotation 

1835 eraApio eraApio13 terrestrial CIRS <-> observed 

1836 

1837 Those with names ending in "13" use contemporary ERFA models to 

1838 compute the various ephemerides. The others accept ephemerides 

1839 supplied by the caller. 

1840 

1841 The transformation from ICRS to GCRS covers space motion, 

1842 parallax, light deflection, and aberration. From GCRS to CIRS 

1843 comprises frame bias and precession-nutation. From CIRS to 

1844 observed takes account of Earth rotation, polar motion, diurnal 

1845 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

1846 transformation), and atmospheric refraction. 

1847 

1848 6) The context structure astrom produced by this function is used by 

1849 eraAtciq* and eraAticq*. 

1850 

1851 Called: 

1852 eraCp copy p-vector 

1853 eraPm modulus of p-vector 

1854 eraPn decompose p-vector into modulus and direction 

1855 eraIr initialize r-matrix to identity 

1856 

1857 This revision: 2021 February 24 

1858 

1859 Copyright (C) 2013-2021, NumFOCUS Foundation. 

1860 Derived, with permission, from the SOFA library. See notes at end of file. 

1861 

1862 """ 

1863 astrom = ufunc.apcs(date1, date2, pv, ebpv, ehp) 

1864 return astrom 

1865 

1866 

1867def apcs13(date1, date2, pv): 

1868 """ 

1869 For an observer whose geocentric position and velocity are known, 

1870 prepare star-independent astrometry parameters for transformations 

1871 between ICRS and GCRS. 

1872 

1873 Parameters 

1874 ---------- 

1875 date1 : double array 

1876 date2 : double array 

1877 pv : double array 

1878 

1879 Returns 

1880 ------- 

1881 astrom : eraASTROM array 

1882 

1883 Notes 

1884 ----- 

1885 Wraps ERFA function ``eraApcs13``. The ERFA documentation is:: 

1886 

1887 - - - - - - - - - - 

1888 e r a A p c s 1 3 

1889 - - - - - - - - - - 

1890 

1891 For an observer whose geocentric position and velocity are known, 

1892 prepare star-independent astrometry parameters for transformations 

1893 between ICRS and GCRS. The Earth ephemeris is from ERFA models. 

1894 

1895 The parameters produced by this function are required in the space 

1896 motion, parallax, light deflection and aberration parts of the 

1897 astrometric transformation chain. 

1898 

1899 Given: 

1900 date1 double TDB as a 2-part... 

1901 date2 double ...Julian Date (Note 1) 

1902 pv double[2][3] observer's geocentric pos/vel (Note 3) 

1903 

1904 Returned: 

1905 astrom eraASTROM star-independent astrometry parameters: 

1906 pmt double PM time interval (SSB, Julian years) 

1907 eb double[3] SSB to observer (vector, au) 

1908 eh double[3] Sun to observer (unit vector) 

1909 em double distance from Sun to observer (au) 

1910 v double[3] barycentric observer velocity (vector, c) 

1911 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

1912 bpn double[3][3] bias-precession-nutation matrix 

1913 along double unchanged 

1914 xpl double unchanged 

1915 ypl double unchanged 

1916 sphi double unchanged 

1917 cphi double unchanged 

1918 diurab double unchanged 

1919 eral double unchanged 

1920 refa double unchanged 

1921 refb double unchanged 

1922 

1923 Notes: 

1924 

1925 1) The TDB date date1+date2 is a Julian Date, apportioned in any 

1926 convenient way between the two arguments. For example, 

1927 JD(TDB)=2450123.7 could be expressed in any of these ways, among 

1928 others: 

1929 

1930 date1 date2 

1931 

1932 2450123.7 0.0 (JD method) 

1933 2451545.0 -1421.3 (J2000 method) 

1934 2400000.5 50123.2 (MJD method) 

1935 2450123.5 0.2 (date & time method) 

1936 

1937 The JD method is the most natural and convenient to use in cases 

1938 where the loss of several decimal digits of resolution is 

1939 acceptable. The J2000 method is best matched to the way the 

1940 argument is handled internally and will deliver the optimum 

1941 resolution. The MJD method and the date & time methods are both 

1942 good compromises between resolution and convenience. For most 

1943 applications of this function the choice will not be at all 

1944 critical. 

1945 

1946 TT can be used instead of TDB without any significant impact on 

1947 accuracy. 

1948 

1949 2) All the vectors are with respect to BCRS axes. 

1950 

1951 3) The observer's position and velocity pv are geocentric but with 

1952 respect to BCRS axes, and in units of m and m/s. No assumptions 

1953 are made about proximity to the Earth, and the function can be 

1954 used for deep space applications as well as Earth orbit and 

1955 terrestrial. 

1956 

1957 4) In cases where the caller wishes to supply his own Earth 

1958 ephemeris, the function eraApcs can be used instead of the present 

1959 function. 

1960 

1961 5) This is one of several functions that inserts into the astrom 

1962 structure star-independent parameters needed for the chain of 

1963 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

1964 

1965 The various functions support different classes of observer and 

1966 portions of the transformation chain: 

1967 

1968 functions observer transformation 

1969 

1970 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

1971 eraApci eraApci13 terrestrial ICRS <-> CIRS 

1972 eraApco eraApco13 terrestrial ICRS <-> observed 

1973 eraApcs eraApcs13 space ICRS <-> GCRS 

1974 eraAper eraAper13 terrestrial update Earth rotation 

1975 eraApio eraApio13 terrestrial CIRS <-> observed 

1976 

1977 Those with names ending in "13" use contemporary ERFA models to 

1978 compute the various ephemerides. The others accept ephemerides 

1979 supplied by the caller. 

1980 

1981 The transformation from ICRS to GCRS covers space motion, 

1982 parallax, light deflection, and aberration. From GCRS to CIRS 

1983 comprises frame bias and precession-nutation. From CIRS to 

1984 observed takes account of Earth rotation, polar motion, diurnal 

1985 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

1986 transformation), and atmospheric refraction. 

1987 

1988 6) The context structure astrom produced by this function is used by 

1989 eraAtciq* and eraAticq*. 

1990 

1991 Called: 

1992 eraEpv00 Earth position and velocity 

1993 eraApcs astrometry parameters, ICRS-GCRS, space observer 

1994 

1995 This revision: 2013 October 9 

1996 

1997 Copyright (C) 2013-2021, NumFOCUS Foundation. 

1998 Derived, with permission, from the SOFA library. See notes at end of file. 

1999 

2000 """ 

2001 astrom = ufunc.apcs13(date1, date2, pv) 

2002 return astrom 

2003 

2004 

2005def aper(theta, astrom): 

2006 """ 

2007 In the star-independent astrometry parameters, update only the 

2008 Earth rotation angle, supplied by the caller explicitly. 

2009 

2010 Parameters 

2011 ---------- 

2012 theta : double array 

2013 astrom : eraASTROM array 

2014 

2015 Returns 

2016 ------- 

2017 astrom : eraASTROM array 

2018 

2019 Notes 

2020 ----- 

2021 Wraps ERFA function ``eraAper``. Note that, unlike the erfa routine, 

2022 the python wrapper does not change astrom in-place. The ERFA documentation is:: 

2023 

2024 - - - - - - - - 

2025 e r a A p e r 

2026 - - - - - - - - 

2027 

2028 In the star-independent astrometry parameters, update only the 

2029 Earth rotation angle, supplied by the caller explicitly. 

2030 

2031 Given: 

2032 theta double Earth rotation angle (radians, Note 2) 

2033 astrom eraASTROM star-independent astrometry parameters: 

2034 pmt double not used 

2035 eb double[3] not used 

2036 eh double[3] not used 

2037 em double not used 

2038 v double[3] not used 

2039 bm1 double not used 

2040 bpn double[3][3] not used 

2041 along double longitude + s' (radians) 

2042 xpl double not used 

2043 ypl double not used 

2044 sphi double not used 

2045 cphi double not used 

2046 diurab double not used 

2047 eral double not used 

2048 refa double not used 

2049 refb double not used 

2050 

2051 Returned: 

2052 astrom eraASTROM star-independent astrometry parameters: 

2053 pmt double unchanged 

2054 eb double[3] unchanged 

2055 eh double[3] unchanged 

2056 em double unchanged 

2057 v double[3] unchanged 

2058 bm1 double unchanged 

2059 bpn double[3][3] unchanged 

2060 along double unchanged 

2061 xpl double unchanged 

2062 ypl double unchanged 

2063 sphi double unchanged 

2064 cphi double unchanged 

2065 diurab double unchanged 

2066 eral double "local" Earth rotation angle (radians) 

2067 refa double unchanged 

2068 refb double unchanged 

2069 

2070 Notes: 

2071 

2072 1) This function exists to enable sidereal-tracking applications to 

2073 avoid wasteful recomputation of the bulk of the astrometry 

2074 parameters: only the Earth rotation is updated. 

2075 

2076 2) For targets expressed as equinox based positions, such as 

2077 classical geocentric apparent (RA,Dec), the supplied theta can be 

2078 Greenwich apparent sidereal time rather than Earth rotation 

2079 angle. 

2080 

2081 3) The function eraAper13 can be used instead of the present 

2082 function, and starts from UT1 rather than ERA itself. 

2083 

2084 4) This is one of several functions that inserts into the astrom 

2085 structure star-independent parameters needed for the chain of 

2086 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

2087 

2088 The various functions support different classes of observer and 

2089 portions of the transformation chain: 

2090 

2091 functions observer transformation 

2092 

2093 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

2094 eraApci eraApci13 terrestrial ICRS <-> CIRS 

2095 eraApco eraApco13 terrestrial ICRS <-> observed 

2096 eraApcs eraApcs13 space ICRS <-> GCRS 

2097 eraAper eraAper13 terrestrial update Earth rotation 

2098 eraApio eraApio13 terrestrial CIRS <-> observed 

2099 

2100 Those with names ending in "13" use contemporary ERFA models to 

2101 compute the various ephemerides. The others accept ephemerides 

2102 supplied by the caller. 

2103 

2104 The transformation from ICRS to GCRS covers space motion, 

2105 parallax, light deflection, and aberration. From GCRS to CIRS 

2106 comprises frame bias and precession-nutation. From CIRS to 

2107 observed takes account of Earth rotation, polar motion, diurnal 

2108 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

2109 transformation), and atmospheric refraction. 

2110 

2111 This revision: 2013 September 25 

2112 

2113 Copyright (C) 2013-2021, NumFOCUS Foundation. 

2114 Derived, with permission, from the SOFA library. See notes at end of file. 

2115 

2116 """ 

2117 astrom = ufunc.aper(theta, astrom) 

2118 return astrom 

2119 

2120 

2121def aper13(ut11, ut12, astrom): 

2122 """ 

2123 In the star-independent astrometry parameters, update only the 

2124 Earth rotation angle. 

2125 

2126 Parameters 

2127 ---------- 

2128 ut11 : double array 

2129 ut12 : double array 

2130 astrom : eraASTROM array 

2131 

2132 Returns 

2133 ------- 

2134 astrom : eraASTROM array 

2135 

2136 Notes 

2137 ----- 

2138 Wraps ERFA function ``eraAper13``. Note that, unlike the erfa routine, 

2139 the python wrapper does not change astrom in-place. The ERFA documentation is:: 

2140 

2141 - - - - - - - - - - 

2142 e r a A p e r 1 3 

2143 - - - - - - - - - - 

2144 

2145 In the star-independent astrometry parameters, update only the 

2146 Earth rotation angle. The caller provides UT1, (n.b. not UTC). 

2147 

2148 Given: 

2149 ut11 double UT1 as a 2-part... 

2150 ut12 double ...Julian Date (Note 1) 

2151 astrom eraASTROM star-independent astrometry parameters: 

2152 pmt double not used 

2153 eb double[3] not used 

2154 eh double[3] not used 

2155 em double not used 

2156 v double[3] not used 

2157 bm1 double not used 

2158 bpn double[3][3] not used 

2159 along double longitude + s' (radians) 

2160 xpl double not used 

2161 ypl double not used 

2162 sphi double not used 

2163 cphi double not used 

2164 diurab double not used 

2165 eral double not used 

2166 refa double not used 

2167 refb double not used 

2168 

2169 Returned: 

2170 astrom eraASTROM star-independent astrometry parameters: 

2171 pmt double unchanged 

2172 eb double[3] unchanged 

2173 eh double[3] unchanged 

2174 em double unchanged 

2175 v double[3] unchanged 

2176 bm1 double unchanged 

2177 bpn double[3][3] unchanged 

2178 along double unchanged 

2179 xpl double unchanged 

2180 ypl double unchanged 

2181 sphi double unchanged 

2182 cphi double unchanged 

2183 diurab double unchanged 

2184 eral double "local" Earth rotation angle (radians) 

2185 refa double unchanged 

2186 refb double unchanged 

2187 

2188 Notes: 

2189 

2190 1) The UT1 date (n.b. not UTC) ut11+ut12 is a Julian Date, 

2191 apportioned in any convenient way between the arguments ut11 and 

2192 ut12. For example, JD(UT1)=2450123.7 could be expressed in any 

2193 of these ways, among others: 

2194 

2195 ut11 ut12 

2196 

2197 2450123.7 0.0 (JD method) 

2198 2451545.0 -1421.3 (J2000 method) 

2199 2400000.5 50123.2 (MJD method) 

2200 2450123.5 0.2 (date & time method) 

2201 

2202 The JD method is the most natural and convenient to use in cases 

2203 where the loss of several decimal digits of resolution is 

2204 acceptable. The J2000 and MJD methods are good compromises 

2205 between resolution and convenience. The date & time method is 

2206 best matched to the algorithm used: maximum precision is 

2207 delivered when the ut11 argument is for 0hrs UT1 on the day in 

2208 question and the ut12 argument lies in the range 0 to 1, or vice 

2209 versa. 

2210 

2211 2) If the caller wishes to provide the Earth rotation angle itself, 

2212 the function eraAper can be used instead. One use of this 

2213 technique is to substitute Greenwich apparent sidereal time and 

2214 thereby to support equinox based transformations directly. 

2215 

2216 3) This is one of several functions that inserts into the astrom 

2217 structure star-independent parameters needed for the chain of 

2218 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

2219 

2220 The various functions support different classes of observer and 

2221 portions of the transformation chain: 

2222 

2223 functions observer transformation 

2224 

2225 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

2226 eraApci eraApci13 terrestrial ICRS <-> CIRS 

2227 eraApco eraApco13 terrestrial ICRS <-> observed 

2228 eraApcs eraApcs13 space ICRS <-> GCRS 

2229 eraAper eraAper13 terrestrial update Earth rotation 

2230 eraApio eraApio13 terrestrial CIRS <-> observed 

2231 

2232 Those with names ending in "13" use contemporary ERFA models to 

2233 compute the various ephemerides. The others accept ephemerides 

2234 supplied by the caller. 

2235 

2236 The transformation from ICRS to GCRS covers space motion, 

2237 parallax, light deflection, and aberration. From GCRS to CIRS 

2238 comprises frame bias and precession-nutation. From CIRS to 

2239 observed takes account of Earth rotation, polar motion, diurnal 

2240 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

2241 transformation), and atmospheric refraction. 

2242 

2243 Called: 

2244 eraAper astrometry parameters: update ERA 

2245 eraEra00 Earth rotation angle, IAU 2000 

2246 

2247 This revision: 2013 September 25 

2248 

2249 Copyright (C) 2013-2021, NumFOCUS Foundation. 

2250 Derived, with permission, from the SOFA library. See notes at end of file. 

2251 

2252 """ 

2253 astrom = ufunc.aper13(ut11, ut12, astrom) 

2254 return astrom 

2255 

2256 

2257def apio(sp, theta, elong, phi, hm, xp, yp, refa, refb): 

2258 """ 

2259 For a terrestrial observer, prepare star-independent astrometry 

2260 parameters for transformations between CIRS and observed 

2261 coordinates. 

2262 

2263 Parameters 

2264 ---------- 

2265 sp : double array 

2266 theta : double array 

2267 elong : double array 

2268 phi : double array 

2269 hm : double array 

2270 xp : double array 

2271 yp : double array 

2272 refa : double array 

2273 refb : double array 

2274 

2275 Returns 

2276 ------- 

2277 astrom : eraASTROM array 

2278 

2279 Notes 

2280 ----- 

2281 Wraps ERFA function ``eraApio``. The ERFA documentation is:: 

2282 

2283 - - - - - - - - 

2284 e r a A p i o 

2285 - - - - - - - - 

2286 

2287 For a terrestrial observer, prepare star-independent astrometry 

2288 parameters for transformations between CIRS and observed 

2289 coordinates. The caller supplies the Earth orientation information 

2290 and the refraction constants as well as the site coordinates. 

2291 

2292 Given: 

2293 sp double the TIO locator s' (radians, Note 1) 

2294 theta double Earth rotation angle (radians) 

2295 elong double longitude (radians, east +ve, Note 2) 

2296 phi double geodetic latitude (radians, Note 2) 

2297 hm double height above ellipsoid (m, geodetic Note 2) 

2298 xp,yp double polar motion coordinates (radians, Note 3) 

2299 refa double refraction constant A (radians, Note 4) 

2300 refb double refraction constant B (radians, Note 4) 

2301 

2302 Returned: 

2303 astrom eraASTROM star-independent astrometry parameters: 

2304 pmt double unchanged 

2305 eb double[3] unchanged 

2306 eh double[3] unchanged 

2307 em double unchanged 

2308 v double[3] unchanged 

2309 bm1 double unchanged 

2310 bpn double[3][3] unchanged 

2311 along double adjusted longitude (radians) 

2312 xpl double polar motion xp wrt local meridian (radians) 

2313 ypl double polar motion yp wrt local meridian (radians) 

2314 sphi double sine of geodetic latitude 

2315 cphi double cosine of geodetic latitude 

2316 diurab double magnitude of diurnal aberration vector 

2317 eral double "local" Earth rotation angle (radians) 

2318 refa double refraction constant A (radians) 

2319 refb double refraction constant B (radians) 

2320 

2321 Notes: 

2322 

2323 1) sp, the TIO locator s', is a tiny quantity needed only by the 

2324 most precise applications. It can either be set to zero or 

2325 predicted using the ERFA function eraSp00. 

2326 

2327 2) The geographical coordinates are with respect to the ERFA_WGS84 

2328 reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the 

2329 longitude required by the present function is east-positive 

2330 (i.e. right-handed), in accordance with geographical convention. 

2331 

2332 3) The polar motion xp,yp can be obtained from IERS bulletins. The 

2333 values are the coordinates (in radians) of the Celestial 

2334 Intermediate Pole with respect to the International Terrestrial 

2335 Reference System (see IERS Conventions 2003), measured along the 

2336 meridians 0 and 90 deg west respectively. For many applications, 

2337 xp and yp can be set to zero. 

2338 

2339 Internally, the polar motion is stored in a form rotated onto the 

2340 local meridian. 

2341 

2342 4) The refraction constants refa and refb are for use in a 

2343 dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed 

2344 (i.e. refracted) zenith distance and dZ is the amount of 

2345 refraction. 

2346 

2347 5) It is advisable to take great care with units, as even unlikely 

2348 values of the input parameters are accepted and processed in 

2349 accordance with the models used. 

2350 

2351 6) In cases where the caller does not wish to provide the Earth 

2352 rotation information and refraction constants, the function 

2353 eraApio13 can be used instead of the present function. This 

2354 starts from UTC and weather readings etc. and computes suitable 

2355 values using other ERFA functions. 

2356 

2357 7) This is one of several functions that inserts into the astrom 

2358 structure star-independent parameters needed for the chain of 

2359 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

2360 

2361 The various functions support different classes of observer and 

2362 portions of the transformation chain: 

2363 

2364 functions observer transformation 

2365 

2366 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

2367 eraApci eraApci13 terrestrial ICRS <-> CIRS 

2368 eraApco eraApco13 terrestrial ICRS <-> observed 

2369 eraApcs eraApcs13 space ICRS <-> GCRS 

2370 eraAper eraAper13 terrestrial update Earth rotation 

2371 eraApio eraApio13 terrestrial CIRS <-> observed 

2372 

2373 Those with names ending in "13" use contemporary ERFA models to 

2374 compute the various ephemerides. The others accept ephemerides 

2375 supplied by the caller. 

2376 

2377 The transformation from ICRS to GCRS covers space motion, 

2378 parallax, light deflection, and aberration. From GCRS to CIRS 

2379 comprises frame bias and precession-nutation. From CIRS to 

2380 observed takes account of Earth rotation, polar motion, diurnal 

2381 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

2382 transformation), and atmospheric refraction. 

2383 

2384 8) The context structure astrom produced by this function is used by 

2385 eraAtioq and eraAtoiq. 

2386 

2387 Called: 

2388 eraIr initialize r-matrix to identity 

2389 eraRz rotate around Z-axis 

2390 eraRy rotate around Y-axis 

2391 eraRx rotate around X-axis 

2392 eraAnpm normalize angle into range +/- pi 

2393 eraPvtob position/velocity of terrestrial station 

2394 

2395 This revision: 2021 February 24 

2396 

2397 Copyright (C) 2013-2021, NumFOCUS Foundation. 

2398 Derived, with permission, from the SOFA library. See notes at end of file. 

2399 

2400 """ 

2401 astrom = ufunc.apio(sp, theta, elong, phi, hm, xp, yp, refa, refb) 

2402 return astrom 

2403 

2404 

2405def apio13(utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl): 

2406 """ 

2407 For a terrestrial observer, prepare star-independent astrometry 

2408 parameters for transformations between CIRS and observed 

2409 coordinates. 

2410 

2411 Parameters 

2412 ---------- 

2413 utc1 : double array 

2414 utc2 : double array 

2415 dut1 : double array 

2416 elong : double array 

2417 phi : double array 

2418 hm : double array 

2419 xp : double array 

2420 yp : double array 

2421 phpa : double array 

2422 tc : double array 

2423 rh : double array 

2424 wl : double array 

2425 

2426 Returns 

2427 ------- 

2428 astrom : eraASTROM array 

2429 

2430 Notes 

2431 ----- 

2432 Wraps ERFA function ``eraApio13``. The ERFA documentation is:: 

2433 

2434 - - - - - - - - - - 

2435 e r a A p i o 1 3 

2436 - - - - - - - - - - 

2437 

2438 For a terrestrial observer, prepare star-independent astrometry 

2439 parameters for transformations between CIRS and observed 

2440 coordinates. The caller supplies UTC, site coordinates, ambient air 

2441 conditions and observing wavelength. 

2442 

2443 Given: 

2444 utc1 double UTC as a 2-part... 

2445 utc2 double ...quasi Julian Date (Notes 1,2) 

2446 dut1 double UT1-UTC (seconds) 

2447 elong double longitude (radians, east +ve, Note 3) 

2448 phi double geodetic latitude (radians, Note 3) 

2449 hm double height above ellipsoid (m, geodetic Notes 4,6) 

2450 xp,yp double polar motion coordinates (radians, Note 5) 

2451 phpa double pressure at the observer (hPa = mB, Note 6) 

2452 tc double ambient temperature at the observer (deg C) 

2453 rh double relative humidity at the observer (range 0-1) 

2454 wl double wavelength (micrometers, Note 7) 

2455 

2456 Returned: 

2457 astrom eraASTROM star-independent astrometry parameters: 

2458 pmt double unchanged 

2459 eb double[3] unchanged 

2460 eh double[3] unchanged 

2461 em double unchanged 

2462 v double[3] unchanged 

2463 bm1 double unchanged 

2464 bpn double[3][3] unchanged 

2465 along double longitude + s' (radians) 

2466 xpl double polar motion xp wrt local meridian (radians) 

2467 ypl double polar motion yp wrt local meridian (radians) 

2468 sphi double sine of geodetic latitude 

2469 cphi double cosine of geodetic latitude 

2470 diurab double magnitude of diurnal aberration vector 

2471 eral double "local" Earth rotation angle (radians) 

2472 refa double refraction constant A (radians) 

2473 refb double refraction constant B (radians) 

2474 

2475 Returned (function value): 

2476 int status: +1 = dubious year (Note 2) 

2477 0 = OK 

2478 -1 = unacceptable date 

2479 

2480 Notes: 

2481 

2482 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any 

2483 convenient way between the two arguments, for example where utc1 

2484 is the Julian Day Number and utc2 is the fraction of a day. 

2485 

2486 However, JD cannot unambiguously represent UTC during a leap 

2487 second unless special measures are taken. The convention in the 

2488 present function is that the JD day represents UTC days whether 

2489 the length is 86399, 86400 or 86401 SI seconds. 

2490 

2491 Applications should use the function eraDtf2d to convert from 

2492 calendar date and time of day into 2-part quasi Julian Date, as 

2493 it implements the leap-second-ambiguity convention just 

2494 described. 

2495 

2496 2) The warning status "dubious year" flags UTCs that predate the 

2497 introduction of the time scale or that are too far in the future 

2498 to be trusted. See eraDat for further details. 

2499 

2500 3) UT1-UTC is tabulated in IERS bulletins. It increases by exactly 

2501 one second at the end of each positive UTC leap second, 

2502 introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This 

2503 practice is under review, and in the future UT1-UTC may grow 

2504 essentially without limit. 

2505 

2506 4) The geographical coordinates are with respect to the ERFA_WGS84 

2507 reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the 

2508 longitude required by the present function is east-positive 

2509 (i.e. right-handed), in accordance with geographical convention. 

2510 

2511 5) The polar motion xp,yp can be obtained from IERS bulletins. The 

2512 values are the coordinates (in radians) of the Celestial 

2513 Intermediate Pole with respect to the International Terrestrial 

2514 Reference System (see IERS Conventions 2003), measured along the 

2515 meridians 0 and 90 deg west respectively. For many applications, 

2516 xp and yp can be set to zero. 

2517 

2518 Internally, the polar motion is stored in a form rotated onto 

2519 the local meridian. 

2520 

2521 6) If hm, the height above the ellipsoid of the observing station 

2522 in meters, is not known but phpa, the pressure in hPa (=mB), is 

2523 available, an adequate estimate of hm can be obtained from the 

2524 expression 

2525 

2526 hm = -29.3 * tsl * log ( phpa / 1013.25 ); 

2527 

2528 where tsl is the approximate sea-level air temperature in K 

2529 (See Astrophysical Quantities, C.W.Allen, 3rd edition, section 

2530 52). Similarly, if the pressure phpa is not known, it can be 

2531 estimated from the height of the observing station, hm, as 

2532 follows: 

2533 

2534 phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); 

2535 

2536 Note, however, that the refraction is nearly proportional to the 

2537 pressure and that an accurate phpa value is important for 

2538 precise work. 

2539 

2540 7) The argument wl specifies the observing wavelength in 

2541 micrometers. The transition from optical to radio is assumed to 

2542 occur at 100 micrometers (about 3000 GHz). 

2543 

2544 8) It is advisable to take great care with units, as even unlikely 

2545 values of the input parameters are accepted and processed in 

2546 accordance with the models used. 

2547 

2548 9) In cases where the caller wishes to supply his own Earth 

2549 rotation information and refraction constants, the function 

2550 eraApc can be used instead of the present function. 

2551 

2552 10) This is one of several functions that inserts into the astrom 

2553 structure star-independent parameters needed for the chain of 

2554 astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. 

2555 

2556 The various functions support different classes of observer and 

2557 portions of the transformation chain: 

2558 

2559 functions observer transformation 

2560 

2561 eraApcg eraApcg13 geocentric ICRS <-> GCRS 

2562 eraApci eraApci13 terrestrial ICRS <-> CIRS 

2563 eraApco eraApco13 terrestrial ICRS <-> observed 

2564 eraApcs eraApcs13 space ICRS <-> GCRS 

2565 eraAper eraAper13 terrestrial update Earth rotation 

2566 eraApio eraApio13 terrestrial CIRS <-> observed 

2567 

2568 Those with names ending in "13" use contemporary ERFA models to 

2569 compute the various ephemerides. The others accept ephemerides 

2570 supplied by the caller. 

2571 

2572 The transformation from ICRS to GCRS covers space motion, 

2573 parallax, light deflection, and aberration. From GCRS to CIRS 

2574 comprises frame bias and precession-nutation. From CIRS to 

2575 observed takes account of Earth rotation, polar motion, diurnal 

2576 aberration and parallax (unless subsumed into the ICRS <-> GCRS 

2577 transformation), and atmospheric refraction. 

2578 

2579 11) The context structure astrom produced by this function is used 

2580 by eraAtioq and eraAtoiq. 

2581 

2582 Called: 

2583 eraUtctai UTC to TAI 

2584 eraTaitt TAI to TT 

2585 eraUtcut1 UTC to UT1 

2586 eraSp00 the TIO locator s', IERS 2000 

2587 eraEra00 Earth rotation angle, IAU 2000 

2588 eraRefco refraction constants for given ambient conditions 

2589 eraApio astrometry parameters, CIRS-observed 

2590 

2591 This revision: 2021 February 24 

2592 

2593 Copyright (C) 2013-2021, NumFOCUS Foundation. 

2594 Derived, with permission, from the SOFA library. See notes at end of file. 

2595 

2596 """ 

2597 astrom, c_retval = ufunc.apio13( 

2598 utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) 

2599 check_errwarn(c_retval, 'apio13') 

2600 return astrom 

2601 

2602 

2603STATUS_CODES['apio13'] = { 

2604 1: 'dubious year (Note 2)', 

2605 0: 'OK', 

2606 -1: 'unacceptable date', 

2607} 

2608 

2609 

2610def atcc13(rc, dc, pr, pd, px, rv, date1, date2): 

2611 """ 

2612 Transform a star's ICRS catalog entry (epoch J2000.0) into ICRS 

2613 astrometric place. 

2614 

2615 Parameters 

2616 ---------- 

2617 rc : double array 

2618 dc : double array 

2619 pr : double array 

2620 pd : double array 

2621 px : double array 

2622 rv : double array 

2623 date1 : double array 

2624 date2 : double array 

2625 

2626 Returns 

2627 ------- 

2628 ra : double array 

2629 da : double array 

2630 

2631 Notes 

2632 ----- 

2633 Wraps ERFA function ``eraAtcc13``. The ERFA documentation is:: 

2634 

2635 - - - - - - - - - - 

2636 e r a A t c c 1 3 

2637 - - - - - - - - - - 

2638 

2639 Transform a star's ICRS catalog entry (epoch J2000.0) into ICRS 

2640 astrometric place. 

2641 

2642 Given: 

2643 rc double ICRS right ascension at J2000.0 (radians, Note 1) 

2644 dc double ICRS declination at J2000.0 (radians, Note 1) 

2645 pr double RA proper motion (radians/year, Note 2) 

2646 pd double Dec proper motion (radians/year) 

2647 px double parallax (arcsec) 

2648 rv double radial velocity (km/s, +ve if receding) 

2649 date1 double TDB as a 2-part... 

2650 date2 double ...Julian Date (Note 3) 

2651 

2652 Returned: 

2653 ra,da double ICRS astrometric RA,Dec (radians) 

2654 

2655 Notes: 

2656 

2657 1) Star data for an epoch other than J2000.0 (for example from the 

2658 Hipparcos catalog, which has an epoch of J1991.25) will require a 

2659 preliminary call to eraPmsafe before use. 

2660 

2661 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. 

2662 

2663 3) The TDB date date1+date2 is a Julian Date, apportioned in any 

2664 convenient way between the two arguments. For example, 

2665 JD(TDB)=2450123.7 could be expressed in any of these ways, among 

2666 others: 

2667 

2668 date1 date2 

2669 

2670 2450123.7 0.0 (JD method) 

2671 2451545.0 -1421.3 (J2000 method) 

2672 2400000.5 50123.2 (MJD method) 

2673 2450123.5 0.2 (date & time method) 

2674 

2675 The JD method is the most natural and convenient to use in cases 

2676 where the loss of several decimal digits of resolution is 

2677 acceptable. The J2000 method is best matched to the way the 

2678 argument is handled internally and will deliver the optimum 

2679 resolution. The MJD method and the date & time methods are both 

2680 good compromises between resolution and convenience. For most 

2681 applications of this function the choice will not be at all 

2682 critical. 

2683 

2684 TT can be used instead of TDB without any significant impact on 

2685 accuracy. 

2686 

2687 Called: 

2688 eraApci13 astrometry parameters, ICRS-CIRS, 2013 

2689 eraAtccq quick catalog ICRS to astrometric 

2690 

2691 This revision: 2021 April 18 

2692 

2693 Copyright (C) 2013-2021, NumFOCUS Foundation. 

2694 Derived, with permission, from the SOFA library. See notes at end of file. 

2695 

2696 """ 

2697 ra, da = ufunc.atcc13(rc, dc, pr, pd, px, rv, date1, date2) 

2698 return ra, da 

2699 

2700 

2701def atccq(rc, dc, pr, pd, px, rv, astrom): 

2702 """ 

2703 Quick transformation of a star's ICRS catalog entry (epoch J2000.0) 

2704 into ICRS astrometric place, given precomputed star-independent 

2705 astrometry parameters. 

2706 

2707 Parameters 

2708 ---------- 

2709 rc : double array 

2710 dc : double array 

2711 pr : double array 

2712 pd : double array 

2713 px : double array 

2714 rv : double array 

2715 astrom : eraASTROM array 

2716 

2717 Returns 

2718 ------- 

2719 ra : double array 

2720 da : double array 

2721 

2722 Notes 

2723 ----- 

2724 Wraps ERFA function ``eraAtccq``. The ERFA documentation is:: 

2725 

2726 - - - - - - - - - 

2727 e r a A t c c q 

2728 - - - - - - - - - 

2729 

2730 Quick transformation of a star's ICRS catalog entry (epoch J2000.0) 

2731 into ICRS astrometric place, given precomputed star-independent 

2732 astrometry parameters. 

2733 

2734 Use of this function is appropriate when efficiency is important and 

2735 where many star positions are to be transformed for one date. The 

2736 star-independent parameters can be obtained by calling one of the 

2737 functions eraApci[13], eraApcg[13], eraApco[13] or eraApcs[13]. 

2738 

2739 If the parallax and proper motions are zero the transformation has 

2740 no effect. 

2741 

2742 Given: 

2743 rc,dc double ICRS RA,Dec at J2000.0 (radians) 

2744 pr double RA proper motion (radians/year, Note 3) 

2745 pd double Dec proper motion (radians/year) 

2746 px double parallax (arcsec) 

2747 rv double radial velocity (km/s, +ve if receding) 

2748 astrom eraASTROM* star-independent astrometry parameters: 

2749 pmt double PM time interval (SSB, Julian years) 

2750 eb double[3] SSB to observer (vector, au) 

2751 eh double[3] Sun to observer (unit vector) 

2752 em double distance from Sun to observer (au) 

2753 v double[3] barycentric observer velocity (vector, c) 

2754 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

2755 bpn double[3][3] bias-precession-nutation matrix 

2756 along double longitude + s' (radians) 

2757 xpl double polar motion xp wrt local meridian (radians) 

2758 ypl double polar motion yp wrt local meridian (radians) 

2759 sphi double sine of geodetic latitude 

2760 cphi double cosine of geodetic latitude 

2761 diurab double magnitude of diurnal aberration vector 

2762 eral double "local" Earth rotation angle (radians) 

2763 refa double refraction constant A (radians) 

2764 refb double refraction constant B (radians) 

2765 

2766 Returned: 

2767 ra,da double ICRS astrometric RA,Dec (radians) 

2768 

2769 Notes: 

2770 

2771 1) All the vectors are with respect to BCRS axes. 

2772 

2773 2) Star data for an epoch other than J2000.0 (for example from the 

2774 Hipparcos catalog, which has an epoch of J1991.25) will require a 

2775 preliminary call to eraPmsafe before use. 

2776 

2777 3) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. 

2778 

2779 Called: 

2780 eraPmpx proper motion and parallax 

2781 eraC2s p-vector to spherical 

2782 eraAnp normalize angle into range 0 to 2pi 

2783 

2784 This revision: 2021 April 18 

2785 

2786 Copyright (C) 2013-2021, NumFOCUS Foundation. 

2787 Derived, with permission, from the SOFA library. See notes at end of file. 

2788 

2789 """ 

2790 ra, da = ufunc.atccq(rc, dc, pr, pd, px, rv, astrom) 

2791 return ra, da 

2792 

2793 

2794def atci13(rc, dc, pr, pd, px, rv, date1, date2): 

2795 """ 

2796 Transform ICRS star data, epoch J2000.0, to CIRS. 

2797 

2798 Parameters 

2799 ---------- 

2800 rc : double array 

2801 dc : double array 

2802 pr : double array 

2803 pd : double array 

2804 px : double array 

2805 rv : double array 

2806 date1 : double array 

2807 date2 : double array 

2808 

2809 Returns 

2810 ------- 

2811 ri : double array 

2812 di : double array 

2813 eo : double array 

2814 

2815 Notes 

2816 ----- 

2817 Wraps ERFA function ``eraAtci13``. The ERFA documentation is:: 

2818 

2819 - - - - - - - - - - 

2820 e r a A t c i 1 3 

2821 - - - - - - - - - - 

2822 

2823 Transform ICRS star data, epoch J2000.0, to CIRS. 

2824 

2825 Given: 

2826 rc double ICRS right ascension at J2000.0 (radians, Note 1) 

2827 dc double ICRS declination at J2000.0 (radians, Note 1) 

2828 pr double RA proper motion (radians/year, Note 2) 

2829 pd double Dec proper motion (radians/year) 

2830 px double parallax (arcsec) 

2831 rv double radial velocity (km/s, +ve if receding) 

2832 date1 double TDB as a 2-part... 

2833 date2 double ...Julian Date (Note 3) 

2834 

2835 Returned: 

2836 ri,di double CIRS geocentric RA,Dec (radians) 

2837 eo double equation of the origins (ERA-GST, Note 5) 

2838 

2839 Notes: 

2840 

2841 1) Star data for an epoch other than J2000.0 (for example from the 

2842 Hipparcos catalog, which has an epoch of J1991.25) will require a 

2843 preliminary call to eraPmsafe before use. 

2844 

2845 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. 

2846 

2847 3) The TDB date date1+date2 is a Julian Date, apportioned in any 

2848 convenient way between the two arguments. For example, 

2849 JD(TDB)=2450123.7 could be expressed in any of these ways, among 

2850 others: 

2851 

2852 date1 date2 

2853 

2854 2450123.7 0.0 (JD method) 

2855 2451545.0 -1421.3 (J2000 method) 

2856 2400000.5 50123.2 (MJD method) 

2857 2450123.5 0.2 (date & time method) 

2858 

2859 The JD method is the most natural and convenient to use in cases 

2860 where the loss of several decimal digits of resolution is 

2861 acceptable. The J2000 method is best matched to the way the 

2862 argument is handled internally and will deliver the optimum 

2863 resolution. The MJD method and the date & time methods are both 

2864 good compromises between resolution and convenience. For most 

2865 applications of this function the choice will not be at all 

2866 critical. 

2867 

2868 TT can be used instead of TDB without any significant impact on 

2869 accuracy. 

2870 

2871 4) The available accuracy is better than 1 milliarcsecond, limited 

2872 mainly by the precession-nutation model that is used, namely 

2873 IAU 2000A/2006. Very close to solar system bodies, additional 

2874 errors of up to several milliarcseconds can occur because of 

2875 unmodeled light deflection; however, the Sun's contribution is 

2876 taken into account, to first order. The accuracy limitations of 

2877 the ERFA function eraEpv00 (used to compute Earth position and 

2878 velocity) can contribute aberration errors of up to 

2879 5 microarcseconds. Light deflection at the Sun's limb is 

2880 uncertain at the 0.4 mas level. 

2881 

2882 5) Should the transformation to (equinox based) apparent place be 

2883 required rather than (CIO based) intermediate place, subtract the 

2884 equation of the origins from the returned right ascension: 

2885 RA = RI - EO. (The eraAnp function can then be applied, as 

2886 required, to keep the result in the conventional 0-2pi range.) 

2887 

2888 Called: 

2889 eraApci13 astrometry parameters, ICRS-CIRS, 2013 

2890 eraAtciq quick ICRS to CIRS 

2891 

2892 This revision: 2021 April 3 

2893 

2894 Copyright (C) 2013-2021, NumFOCUS Foundation. 

2895 Derived, with permission, from the SOFA library. See notes at end of file. 

2896 

2897 """ 

2898 ri, di, eo = ufunc.atci13(rc, dc, pr, pd, px, rv, date1, date2) 

2899 return ri, di, eo 

2900 

2901 

2902def atciq(rc, dc, pr, pd, px, rv, astrom): 

2903 """ 

2904 Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed 

2905 star-independent astrometry parameters. 

2906 

2907 Parameters 

2908 ---------- 

2909 rc : double array 

2910 dc : double array 

2911 pr : double array 

2912 pd : double array 

2913 px : double array 

2914 rv : double array 

2915 astrom : eraASTROM array 

2916 

2917 Returns 

2918 ------- 

2919 ri : double array 

2920 di : double array 

2921 

2922 Notes 

2923 ----- 

2924 Wraps ERFA function ``eraAtciq``. The ERFA documentation is:: 

2925 

2926 - - - - - - - - - 

2927 e r a A t c i q 

2928 - - - - - - - - - 

2929 

2930 Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed 

2931 star-independent astrometry parameters. 

2932 

2933 Use of this function is appropriate when efficiency is important and 

2934 where many star positions are to be transformed for one date. The 

2935 star-independent parameters can be obtained by calling one of the 

2936 functions eraApci[13], eraApcg[13], eraApco[13] or eraApcs[13]. 

2937 

2938 If the parallax and proper motions are zero the eraAtciqz function 

2939 can be used instead. 

2940 

2941 Given: 

2942 rc,dc double ICRS RA,Dec at J2000.0 (radians, Note 1) 

2943 pr double RA proper motion (radians/year, Note 2) 

2944 pd double Dec proper motion (radians/year) 

2945 px double parallax (arcsec) 

2946 rv double radial velocity (km/s, +ve if receding) 

2947 astrom eraASTROM* star-independent astrometry parameters: 

2948 pmt double PM time interval (SSB, Julian years) 

2949 eb double[3] SSB to observer (vector, au) 

2950 eh double[3] Sun to observer (unit vector) 

2951 em double distance from Sun to observer (au) 

2952 v double[3] barycentric observer velocity (vector, c) 

2953 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

2954 bpn double[3][3] bias-precession-nutation matrix 

2955 along double longitude + s' (radians) 

2956 xpl double polar motion xp wrt local meridian (radians) 

2957 ypl double polar motion yp wrt local meridian (radians) 

2958 sphi double sine of geodetic latitude 

2959 cphi double cosine of geodetic latitude 

2960 diurab double magnitude of diurnal aberration vector 

2961 eral double "local" Earth rotation angle (radians) 

2962 refa double refraction constant A (radians) 

2963 refb double refraction constant B (radians) 

2964 

2965 Returned: 

2966 ri,di double CIRS RA,Dec (radians) 

2967 

2968 Notes: 

2969 

2970 1) Star data for an epoch other than J2000.0 (for example from the 

2971 Hipparcos catalog, which has an epoch of J1991.25) will require a 

2972 preliminary call to eraPmsafe before use. 

2973 

2974 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. 

2975 

2976 Called: 

2977 eraPmpx proper motion and parallax 

2978 eraLdsun light deflection by the Sun 

2979 eraAb stellar aberration 

2980 eraRxp product of r-matrix and pv-vector 

2981 eraC2s p-vector to spherical 

2982 eraAnp normalize angle into range 0 to 2pi 

2983 

2984 This revision: 2021 April 19 

2985 

2986 Copyright (C) 2013-2021, NumFOCUS Foundation. 

2987 Derived, with permission, from the SOFA library. See notes at end of file. 

2988 

2989 """ 

2990 ri, di = ufunc.atciq(rc, dc, pr, pd, px, rv, astrom) 

2991 return ri, di 

2992 

2993 

2994def atciqn(rc, dc, pr, pd, px, rv, astrom, b): 

2995 """ 

2996 Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed 

2997 star-independent astrometry parameters plus a list of light- 

2998 deflecting bodies. 

2999 

3000 Parameters 

3001 ---------- 

3002 rc : double array 

3003 dc : double array 

3004 pr : double array 

3005 pd : double array 

3006 px : double array 

3007 rv : double array 

3008 astrom : eraASTROM array 

3009 b : eraLDBODY array 

3010 

3011 Returns 

3012 ------- 

3013 ri : double array 

3014 di : double array 

3015 

3016 Notes 

3017 ----- 

3018 Wraps ERFA function ``eraAtciqn``. The ERFA documentation is:: 

3019 

3020 - - - - - - - - - - 

3021 e r a A t c i q n 

3022 - - - - - - - - - - 

3023 

3024 Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed 

3025 star-independent astrometry parameters plus a list of light- 

3026 deflecting bodies. 

3027 

3028 Use of this function is appropriate when efficiency is important and 

3029 where many star positions are to be transformed for one date. The 

3030 star-independent parameters can be obtained by calling one of the 

3031 functions eraApci[13], eraApcg[13], eraApco[13] or eraApcs[13]. 

3032 

3033 

3034 If the only light-deflecting body to be taken into account is the 

3035 Sun, the eraAtciq function can be used instead. If in addition the 

3036 parallax and proper motions are zero, the eraAtciqz function can be 

3037 used. 

3038 

3039 Given: 

3040 rc,dc double ICRS RA,Dec at J2000.0 (radians) 

3041 pr double RA proper motion (radians/year, Note 3) 

3042 pd double Dec proper motion (radians/year) 

3043 px double parallax (arcsec) 

3044 rv double radial velocity (km/s, +ve if receding) 

3045 astrom eraASTROM star-independent astrometry parameters: 

3046 pmt double PM time interval (SSB, Julian years) 

3047 eb double[3] SSB to observer (vector, au) 

3048 eh double[3] Sun to observer (unit vector) 

3049 em double distance from Sun to observer (au) 

3050 v double[3] barycentric observer velocity (vector, c) 

3051 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

3052 bpn double[3][3] bias-precession-nutation matrix 

3053 along double longitude + s' (radians) 

3054 xpl double polar motion xp wrt local meridian (radians) 

3055 ypl double polar motion yp wrt local meridian (radians) 

3056 sphi double sine of geodetic latitude 

3057 cphi double cosine of geodetic latitude 

3058 diurab double magnitude of diurnal aberration vector 

3059 eral double "local" Earth rotation angle (radians) 

3060 refa double refraction constant A (radians) 

3061 refb double refraction constant B (radians) 

3062 n int number of bodies (Note 3) 

3063 b eraLDBODY[n] data for each of the n bodies (Notes 3,4): 

3064 bm double mass of the body (solar masses, Note 5) 

3065 dl double deflection limiter (Note 6) 

3066 pv [2][3] barycentric PV of the body (au, au/day) 

3067 

3068 Returned: 

3069 ri,di double CIRS RA,Dec (radians) 

3070 

3071 Notes: 

3072 

3073 1) Star data for an epoch other than J2000.0 (for example from the 

3074 Hipparcos catalog, which has an epoch of J1991.25) will require a 

3075 preliminary call to eraPmsafe before use. 

3076 

3077 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. 

3078 

3079 3) The struct b contains n entries, one for each body to be 

3080 considered. If n = 0, no gravitational light deflection will be 

3081 applied, not even for the Sun. 

3082 

3083 4) The struct b should include an entry for the Sun as well as for 

3084 any planet or other body to be taken into account. The entries 

3085 should be in the order in which the light passes the body. 

3086 

3087 5) In the entry in the b struct for body i, the mass parameter 

3088 b[i].bm can, as required, be adjusted in order to allow for such 

3089 effects as quadrupole field. 

3090 

3091 6) The deflection limiter parameter b[i].dl is phi^2/2, where phi is 

3092 the angular separation (in radians) between star and body at 

3093 which limiting is applied. As phi shrinks below the chosen 

3094 threshold, the deflection is artificially reduced, reaching zero 

3095 for phi = 0. Example values suitable for a terrestrial 

3096 observer, together with masses, are as follows: 

3097 

3098 body i b[i].bm b[i].dl 

3099 

3100 Sun 1.0 6e-6 

3101 Jupiter 0.00095435 3e-9 

3102 Saturn 0.00028574 3e-10 

3103 

3104 7) For efficiency, validation of the contents of the b array is 

3105 omitted. The supplied masses must be greater than zero, the 

3106 position and velocity vectors must be right, and the deflection 

3107 limiter greater than zero. 

3108 

3109 Called: 

3110 eraPmpx proper motion and parallax 

3111 eraLdn light deflection by n bodies 

3112 eraAb stellar aberration 

3113 eraRxp product of r-matrix and pv-vector 

3114 eraC2s p-vector to spherical 

3115 eraAnp normalize angle into range 0 to 2pi 

3116 

3117 This revision: 2021 April 3 

3118 

3119 Copyright (C) 2013-2021, NumFOCUS Foundation. 

3120 Derived, with permission, from the SOFA library. See notes at end of file. 

3121 

3122 """ 

3123 ri, di = ufunc.atciqn(rc, dc, pr, pd, px, rv, astrom, b) 

3124 return ri, di 

3125 

3126 

3127def atciqz(rc, dc, astrom): 

3128 """ 

3129 Quick ICRS to CIRS transformation, given precomputed star- 

3130 independent astrometry parameters, and assuming zero parallax and 

3131 proper motion. 

3132 

3133 Parameters 

3134 ---------- 

3135 rc : double array 

3136 dc : double array 

3137 astrom : eraASTROM array 

3138 

3139 Returns 

3140 ------- 

3141 ri : double array 

3142 di : double array 

3143 

3144 Notes 

3145 ----- 

3146 Wraps ERFA function ``eraAtciqz``. The ERFA documentation is:: 

3147 

3148 - - - - - - - - - - 

3149 e r a A t c i q z 

3150 - - - - - - - - - - 

3151 

3152 Quick ICRS to CIRS transformation, given precomputed star- 

3153 independent astrometry parameters, and assuming zero parallax and 

3154 proper motion. 

3155 

3156 Use of this function is appropriate when efficiency is important and 

3157 where many star positions are to be transformed for one date. The 

3158 star-independent parameters can be obtained by calling one of the 

3159 functions eraApci[13], eraApcg[13], eraApco[13] or eraApcs[13]. 

3160 

3161 The corresponding function for the case of non-zero parallax and 

3162 proper motion is eraAtciq. 

3163 

3164 Given: 

3165 rc,dc double ICRS astrometric RA,Dec (radians) 

3166 astrom eraASTROM* star-independent astrometry parameters: 

3167 pmt double PM time interval (SSB, Julian years) 

3168 eb double[3] SSB to observer (vector, au) 

3169 eh double[3] Sun to observer (unit vector) 

3170 em double distance from Sun to observer (au) 

3171 v double[3] barycentric observer velocity (vector, c) 

3172 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

3173 bpn double[3][3] bias-precession-nutation matrix 

3174 along double longitude + s' (radians) 

3175 xpl double polar motion xp wrt local meridian (radians) 

3176 ypl double polar motion yp wrt local meridian (radians) 

3177 sphi double sine of geodetic latitude 

3178 cphi double cosine of geodetic latitude 

3179 diurab double magnitude of diurnal aberration vector 

3180 eral double "local" Earth rotation angle (radians) 

3181 refa double refraction constant A (radians) 

3182 refb double refraction constant B (radians) 

3183 

3184 Returned: 

3185 ri,di double CIRS RA,Dec (radians) 

3186 

3187 Note: 

3188 

3189 All the vectors are with respect to BCRS axes. 

3190 

3191 References: 

3192 

3193 Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to 

3194 the Astronomical Almanac, 3rd ed., University Science Books 

3195 (2013). 

3196 

3197 Klioner, Sergei A., "A practical relativistic model for micro- 

3198 arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003). 

3199 

3200 Called: 

3201 eraS2c spherical coordinates to unit vector 

3202 eraLdsun light deflection due to Sun 

3203 eraAb stellar aberration 

3204 eraRxp product of r-matrix and p-vector 

3205 eraC2s p-vector to spherical 

3206 eraAnp normalize angle into range +/- pi 

3207 

3208 This revision: 2013 October 9 

3209 

3210 Copyright (C) 2013-2021, NumFOCUS Foundation. 

3211 Derived, with permission, from the SOFA library. See notes at end of file. 

3212 

3213 """ 

3214 ri, di = ufunc.atciqz(rc, dc, astrom) 

3215 return ri, di 

3216 

3217 

3218def atco13(rc, dc, pr, pd, px, rv, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl): 

3219 """ 

3220 ICRS RA,Dec to observed place. The caller supplies UTC, site 

3221 coordinates, ambient air conditions and observing wavelength. 

3222 

3223 Parameters 

3224 ---------- 

3225 rc : double array 

3226 dc : double array 

3227 pr : double array 

3228 pd : double array 

3229 px : double array 

3230 rv : double array 

3231 utc1 : double array 

3232 utc2 : double array 

3233 dut1 : double array 

3234 elong : double array 

3235 phi : double array 

3236 hm : double array 

3237 xp : double array 

3238 yp : double array 

3239 phpa : double array 

3240 tc : double array 

3241 rh : double array 

3242 wl : double array 

3243 

3244 Returns 

3245 ------- 

3246 aob : double array 

3247 zob : double array 

3248 hob : double array 

3249 dob : double array 

3250 rob : double array 

3251 eo : double array 

3252 

3253 Notes 

3254 ----- 

3255 Wraps ERFA function ``eraAtco13``. The ERFA documentation is:: 

3256 

3257 - - - - - - - - - - 

3258 e r a A t c o 1 3 

3259 - - - - - - - - - - 

3260 

3261 ICRS RA,Dec to observed place. The caller supplies UTC, site 

3262 coordinates, ambient air conditions and observing wavelength. 

3263 

3264 ERFA models are used for the Earth ephemeris, bias-precession- 

3265 nutation, Earth orientation and refraction. 

3266 

3267 Given: 

3268 rc,dc double ICRS right ascension at J2000.0 (radians, Note 1) 

3269 pr double RA proper motion (radians/year, Note 2) 

3270 pd double Dec proper motion (radians/year) 

3271 px double parallax (arcsec) 

3272 rv double radial velocity (km/s, +ve if receding) 

3273 utc1 double UTC as a 2-part... 

3274 utc2 double ...quasi Julian Date (Notes 3-4) 

3275 dut1 double UT1-UTC (seconds, Note 5) 

3276 elong double longitude (radians, east +ve, Note 6) 

3277 phi double latitude (geodetic, radians, Note 6) 

3278 hm double height above ellipsoid (m, geodetic, Notes 6,8) 

3279 xp,yp double polar motion coordinates (radians, Note 7) 

3280 phpa double pressure at the observer (hPa = mB, Note 8) 

3281 tc double ambient temperature at the observer (deg C) 

3282 rh double relative humidity at the observer (range 0-1) 

3283 wl double wavelength (micrometers, Note 9) 

3284 

3285 Returned: 

3286 aob double observed azimuth (radians: N=0,E=90) 

3287 zob double observed zenith distance (radians) 

3288 hob double observed hour angle (radians) 

3289 dob double observed declination (radians) 

3290 rob double observed right ascension (CIO-based, radians) 

3291 eo double equation of the origins (ERA-GST) 

3292 

3293 Returned (function value): 

3294 int status: +1 = dubious year (Note 4) 

3295 0 = OK 

3296 -1 = unacceptable date 

3297 

3298 Notes: 

3299 

3300 1) Star data for an epoch other than J2000.0 (for example from the 

3301 Hipparcos catalog, which has an epoch of J1991.25) will require 

3302 a preliminary call to eraPmsafe before use. 

3303 

3304 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. 

3305 

3306 3) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any 

3307 convenient way between the two arguments, for example where utc1 

3308 is the Julian Day Number and utc2 is the fraction of a day. 

3309 

3310 However, JD cannot unambiguously represent UTC during a leap 

3311 second unless special measures are taken. The convention in the 

3312 present function is that the JD day represents UTC days whether 

3313 the length is 86399, 86400 or 86401 SI seconds. 

3314 

3315 Applications should use the function eraDtf2d to convert from 

3316 calendar date and time of day into 2-part quasi Julian Date, as 

3317 it implements the leap-second-ambiguity convention just 

3318 described. 

3319 

3320 4) The warning status "dubious year" flags UTCs that predate the 

3321 introduction of the time scale or that are too far in the 

3322 future to be trusted. See eraDat for further details. 

3323 

3324 5) UT1-UTC is tabulated in IERS bulletins. It increases by exactly 

3325 one second at the end of each positive UTC leap second, 

3326 introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This 

3327 practice is under review, and in the future UT1-UTC may grow 

3328 essentially without limit. 

3329 

3330 6) The geographical coordinates are with respect to the ERFA_WGS84 

3331 reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the 

3332 longitude required by the present function is east-positive 

3333 (i.e. right-handed), in accordance with geographical convention. 

3334 

3335 7) The polar motion xp,yp can be obtained from IERS bulletins. The 

3336 values are the coordinates (in radians) of the Celestial 

3337 Intermediate Pole with respect to the International Terrestrial 

3338 Reference System (see IERS Conventions 2003), measured along the 

3339 meridians 0 and 90 deg west respectively. For many 

3340 applications, xp and yp can be set to zero. 

3341 

3342 8) If hm, the height above the ellipsoid of the observing station 

3343 in meters, is not known but phpa, the pressure in hPa (=mB), 

3344 is available, an adequate estimate of hm can be obtained from 

3345 the expression 

3346 

3347 hm = -29.3 * tsl * log ( phpa / 1013.25 ); 

3348 

3349 where tsl is the approximate sea-level air temperature in K 

3350 (See Astrophysical Quantities, C.W.Allen, 3rd edition, section 

3351 52). Similarly, if the pressure phpa is not known, it can be 

3352 estimated from the height of the observing station, hm, as 

3353 follows: 

3354 

3355 phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); 

3356 

3357 Note, however, that the refraction is nearly proportional to 

3358 the pressure and that an accurate phpa value is important for 

3359 precise work. 

3360 

3361 9) The argument wl specifies the observing wavelength in 

3362 micrometers. The transition from optical to radio is assumed to 

3363 occur at 100 micrometers (about 3000 GHz). 

3364 

3365 10) The accuracy of the result is limited by the corrections for 

3366 refraction, which use a simple A*tan(z) + B*tan^3(z) model. 

3367 Providing the meteorological parameters are known accurately and 

3368 there are no gross local effects, the predicted observed 

3369 coordinates should be within 0.05 arcsec (optical) or 1 arcsec 

3370 (radio) for a zenith distance of less than 70 degrees, better 

3371 than 30 arcsec (optical or radio) at 85 degrees and better 

3372 than 20 arcmin (optical) or 30 arcmin (radio) at the horizon. 

3373 

3374 Without refraction, the complementary functions eraAtco13 and 

3375 eraAtoc13 are self-consistent to better than 1 microarcsecond 

3376 all over the celestial sphere. With refraction included, 

3377 consistency falls off at high zenith distances, but is still 

3378 better than 0.05 arcsec at 85 degrees. 

3379 

3380 11) "Observed" Az,ZD means the position that would be seen by a 

3381 perfect geodetically aligned theodolite. (Zenith distance is 

3382 used rather than altitude in order to reflect the fact that no 

3383 allowance is made for depression of the horizon.) This is 

3384 related to the observed HA,Dec via the standard rotation, using 

3385 the geodetic latitude (corrected for polar motion), while the 

3386 observed HA and RA are related simply through the Earth rotation 

3387 angle and the site longitude. "Observed" RA,Dec or HA,Dec thus 

3388 means the position that would be seen by a perfect equatorial 

3389 with its polar axis aligned to the Earth's axis of rotation. 

3390 

3391 12) It is advisable to take great care with units, as even unlikely 

3392 values of the input parameters are accepted and processed in 

3393 accordance with the models used. 

3394 

3395 Called: 

3396 eraApco13 astrometry parameters, ICRS-observed, 2013 

3397 eraAtciq quick ICRS to CIRS 

3398 eraAtioq quick CIRS to observed 

3399 

3400 This revision: 2021 April 3 

3401 

3402 Copyright (C) 2013-2021, NumFOCUS Foundation. 

3403 Derived, with permission, from the SOFA library. See notes at end of file. 

3404 

3405 """ 

3406 aob, zob, hob, dob, rob, eo, c_retval = ufunc.atco13( 

3407 rc, dc, pr, pd, px, rv, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) 

3408 check_errwarn(c_retval, 'atco13') 

3409 return aob, zob, hob, dob, rob, eo 

3410 

3411 

3412STATUS_CODES['atco13'] = { 

3413 1: 'dubious year (Note 4)', 

3414 0: 'OK', 

3415 -1: 'unacceptable date', 

3416} 

3417 

3418 

3419def atic13(ri, di, date1, date2): 

3420 """ 

3421 Transform star RA,Dec from geocentric CIRS to ICRS astrometric. 

3422 

3423 Parameters 

3424 ---------- 

3425 ri : double array 

3426 di : double array 

3427 date1 : double array 

3428 date2 : double array 

3429 

3430 Returns 

3431 ------- 

3432 rc : double array 

3433 dc : double array 

3434 eo : double array 

3435 

3436 Notes 

3437 ----- 

3438 Wraps ERFA function ``eraAtic13``. The ERFA documentation is:: 

3439 

3440 - - - - - - - - - - 

3441 e r a A t i c 1 3 

3442 - - - - - - - - - - 

3443 

3444 Transform star RA,Dec from geocentric CIRS to ICRS astrometric. 

3445 

3446 Given: 

3447 ri,di double CIRS geocentric RA,Dec (radians) 

3448 date1 double TDB as a 2-part... 

3449 date2 double ...Julian Date (Note 1) 

3450 

3451 Returned: 

3452 rc,dc double ICRS astrometric RA,Dec (radians) 

3453 eo double equation of the origins (ERA-GST, Note 4) 

3454 

3455 Notes: 

3456 

3457 1) The TDB date date1+date2 is a Julian Date, apportioned in any 

3458 convenient way between the two arguments. For example, 

3459 JD(TDB)=2450123.7 could be expressed in any of these ways, among 

3460 others: 

3461 

3462 date1 date2 

3463 

3464 2450123.7 0.0 (JD method) 

3465 2451545.0 -1421.3 (J2000 method) 

3466 2400000.5 50123.2 (MJD method) 

3467 2450123.5 0.2 (date & time method) 

3468 

3469 The JD method is the most natural and convenient to use in cases 

3470 where the loss of several decimal digits of resolution is 

3471 acceptable. The J2000 method is best matched to the way the 

3472 argument is handled internally and will deliver the optimum 

3473 resolution. The MJD method and the date & time methods are both 

3474 good compromises between resolution and convenience. For most 

3475 applications of this function the choice will not be at all 

3476 critical. 

3477 

3478 TT can be used instead of TDB without any significant impact on 

3479 accuracy. 

3480 

3481 2) Iterative techniques are used for the aberration and light 

3482 deflection corrections so that the functions eraAtic13 (or 

3483 eraAticq) and eraAtci13 (or eraAtciq) are accurate inverses; 

3484 even at the edge of the Sun's disk the discrepancy is only about 

3485 1 nanoarcsecond. 

3486 

3487 3) The available accuracy is better than 1 milliarcsecond, limited 

3488 mainly by the precession-nutation model that is used, namely 

3489 IAU 2000A/2006. Very close to solar system bodies, additional 

3490 errors of up to several milliarcseconds can occur because of 

3491 unmodeled light deflection; however, the Sun's contribution is 

3492 taken into account, to first order. The accuracy limitations of 

3493 the ERFA function eraEpv00 (used to compute Earth position and 

3494 velocity) can contribute aberration errors of up to 

3495 5 microarcseconds. Light deflection at the Sun's limb is 

3496 uncertain at the 0.4 mas level. 

3497 

3498 4) Should the transformation to (equinox based) J2000.0 mean place 

3499 be required rather than (CIO based) ICRS coordinates, subtract the 

3500 equation of the origins from the returned right ascension: 

3501 RA = RI - EO. (The eraAnp function can then be applied, as 

3502 required, to keep the result in the conventional 0-2pi range.) 

3503 

3504 Called: 

3505 eraApci13 astrometry parameters, ICRS-CIRS, 2013 

3506 eraAticq quick CIRS to ICRS astrometric 

3507 

3508 This revision: 2013 October 9 

3509 

3510 Copyright (C) 2013-2021, NumFOCUS Foundation. 

3511 Derived, with permission, from the SOFA library. See notes at end of file. 

3512 

3513 """ 

3514 rc, dc, eo = ufunc.atic13(ri, di, date1, date2) 

3515 return rc, dc, eo 

3516 

3517 

3518def aticq(ri, di, astrom): 

3519 """ 

3520 Quick CIRS RA,Dec to ICRS astrometric place, given the star- 

3521 independent astrometry parameters. 

3522 

3523 Parameters 

3524 ---------- 

3525 ri : double array 

3526 di : double array 

3527 astrom : eraASTROM array 

3528 

3529 Returns 

3530 ------- 

3531 rc : double array 

3532 dc : double array 

3533 

3534 Notes 

3535 ----- 

3536 Wraps ERFA function ``eraAticq``. The ERFA documentation is:: 

3537 

3538 - - - - - - - - - 

3539 e r a A t i c q 

3540 - - - - - - - - - 

3541 

3542 Quick CIRS RA,Dec to ICRS astrometric place, given the star- 

3543 independent astrometry parameters. 

3544 

3545 Use of this function is appropriate when efficiency is important and 

3546 where many star positions are all to be transformed for one date. 

3547 The star-independent astrometry parameters can be obtained by 

3548 calling one of the functions eraApci[13], eraApcg[13], eraApco[13] 

3549 or eraApcs[13]. 

3550 

3551 Given: 

3552 ri,di double CIRS RA,Dec (radians) 

3553 astrom eraASTROM* star-independent astrometry parameters: 

3554 pmt double PM time interval (SSB, Julian years) 

3555 eb double[3] SSB to observer (vector, au) 

3556 eh double[3] Sun to observer (unit vector) 

3557 em double distance from Sun to observer (au) 

3558 v double[3] barycentric observer velocity (vector, c) 

3559 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

3560 bpn double[3][3] bias-precession-nutation matrix 

3561 along double longitude + s' (radians) 

3562 xpl double polar motion xp wrt local meridian (radians) 

3563 ypl double polar motion yp wrt local meridian (radians) 

3564 sphi double sine of geodetic latitude 

3565 cphi double cosine of geodetic latitude 

3566 diurab double magnitude of diurnal aberration vector 

3567 eral double "local" Earth rotation angle (radians) 

3568 refa double refraction constant A (radians) 

3569 refb double refraction constant B (radians) 

3570 

3571 Returned: 

3572 rc,dc double ICRS astrometric RA,Dec (radians) 

3573 

3574 Notes: 

3575 

3576 1) Only the Sun is taken into account in the light deflection 

3577 correction. 

3578 

3579 2) Iterative techniques are used for the aberration and light 

3580 deflection corrections so that the functions eraAtic13 (or 

3581 eraAticq) and eraAtci13 (or eraAtciq) are accurate inverses; 

3582 even at the edge of the Sun's disk the discrepancy is only about 

3583 1 nanoarcsecond. 

3584 

3585 Called: 

3586 eraS2c spherical coordinates to unit vector 

3587 eraTrxp product of transpose of r-matrix and p-vector 

3588 eraZp zero p-vector 

3589 eraAb stellar aberration 

3590 eraLdsun light deflection by the Sun 

3591 eraC2s p-vector to spherical 

3592 eraAnp normalize angle into range +/- pi 

3593 

3594 This revision: 2013 October 9 

3595 

3596 Copyright (C) 2013-2021, NumFOCUS Foundation. 

3597 Derived, with permission, from the SOFA library. See notes at end of file. 

3598 

3599 """ 

3600 rc, dc = ufunc.aticq(ri, di, astrom) 

3601 return rc, dc 

3602 

3603 

3604def aticqn(ri, di, astrom, b): 

3605 """ 

3606 Quick CIRS to ICRS astrometric place transformation, given the star- 

3607 independent astrometry parameters plus a list of light-deflecting 

3608 bodies. 

3609 

3610 Parameters 

3611 ---------- 

3612 ri : double array 

3613 di : double array 

3614 astrom : eraASTROM array 

3615 b : eraLDBODY array 

3616 

3617 Returns 

3618 ------- 

3619 rc : double array 

3620 dc : double array 

3621 

3622 Notes 

3623 ----- 

3624 Wraps ERFA function ``eraAticqn``. The ERFA documentation is:: 

3625 

3626 - - - - - - - - - - 

3627 e r a A t i c q n 

3628 - - - - - - - - - - 

3629 

3630 Quick CIRS to ICRS astrometric place transformation, given the star- 

3631 independent astrometry parameters plus a list of light-deflecting 

3632 bodies. 

3633 

3634 Use of this function is appropriate when efficiency is important and 

3635 where many star positions are all to be transformed for one date. 

3636 The star-independent astrometry parameters can be obtained by 

3637 calling one of the functions eraApci[13], eraApcg[13], eraApco[13] 

3638 or eraApcs[13]. 

3639 

3640 If the only light-deflecting body to be taken into account is the 

3641 Sun, the eraAticq function can be used instead. 

3642 

3643 Given: 

3644 ri,di double CIRS RA,Dec (radians) 

3645 astrom eraASTROM star-independent astrometry parameters: 

3646 pmt double PM time interval (SSB, Julian years) 

3647 eb double[3] SSB to observer (vector, au) 

3648 eh double[3] Sun to observer (unit vector) 

3649 em double distance from Sun to observer (au) 

3650 v double[3] barycentric observer velocity (vector, c) 

3651 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

3652 bpn double[3][3] bias-precession-nutation matrix 

3653 along double longitude + s' (radians) 

3654 xpl double polar motion xp wrt local meridian (radians) 

3655 ypl double polar motion yp wrt local meridian (radians) 

3656 sphi double sine of geodetic latitude 

3657 cphi double cosine of geodetic latitude 

3658 diurab double magnitude of diurnal aberration vector 

3659 eral double "local" Earth rotation angle (radians) 

3660 refa double refraction constant A (radians) 

3661 refb double refraction constant B (radians) 

3662 n int number of bodies (Note 3) 

3663 b eraLDBODY[n] data for each of the n bodies (Notes 3,4): 

3664 bm double mass of the body (solar masses, Note 5) 

3665 dl double deflection limiter (Note 6) 

3666 pv [2][3] barycentric PV of the body (au, au/day) 

3667 

3668 Returned: 

3669 rc,dc double ICRS astrometric RA,Dec (radians) 

3670 

3671 Notes: 

3672 

3673 1) Iterative techniques are used for the aberration and light 

3674 deflection corrections so that the functions eraAticqn and 

3675 eraAtciqn are accurate inverses; even at the edge of the Sun's 

3676 disk the discrepancy is only about 1 nanoarcsecond. 

3677 

3678 2) If the only light-deflecting body to be taken into account is the 

3679 Sun, the eraAticq function can be used instead. 

3680 

3681 3) The struct b contains n entries, one for each body to be 

3682 considered. If n = 0, no gravitational light deflection will be 

3683 applied, not even for the Sun. 

3684 

3685 4) The struct b should include an entry for the Sun as well as for 

3686 any planet or other body to be taken into account. The entries 

3687 should be in the order in which the light passes the body. 

3688 

3689 5) In the entry in the b struct for body i, the mass parameter 

3690 b[i].bm can, as required, be adjusted in order to allow for such 

3691 effects as quadrupole field. 

3692 

3693 6) The deflection limiter parameter b[i].dl is phi^2/2, where phi is 

3694 the angular separation (in radians) between star and body at 

3695 which limiting is applied. As phi shrinks below the chosen 

3696 threshold, the deflection is artificially reduced, reaching zero 

3697 for phi = 0. Example values suitable for a terrestrial 

3698 observer, together with masses, are as follows: 

3699 

3700 body i b[i].bm b[i].dl 

3701 

3702 Sun 1.0 6e-6 

3703 Jupiter 0.00095435 3e-9 

3704 Saturn 0.00028574 3e-10 

3705 

3706 7) For efficiency, validation of the contents of the b array is 

3707 omitted. The supplied masses must be greater than zero, the 

3708 position and velocity vectors must be right, and the deflection 

3709 limiter greater than zero. 

3710 

3711 Called: 

3712 eraS2c spherical coordinates to unit vector 

3713 eraTrxp product of transpose of r-matrix and p-vector 

3714 eraZp zero p-vector 

3715 eraAb stellar aberration 

3716 eraLdn light deflection by n bodies 

3717 eraC2s p-vector to spherical 

3718 eraAnp normalize angle into range +/- pi 

3719 

3720 This revision: 2021 January 6 

3721 

3722 Copyright (C) 2013-2021, NumFOCUS Foundation. 

3723 Derived, with permission, from the SOFA library. See notes at end of file. 

3724 

3725 """ 

3726 rc, dc = ufunc.aticqn(ri, di, astrom, b) 

3727 return rc, dc 

3728 

3729 

3730def atio13(ri, di, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl): 

3731 """ 

3732 CIRS RA,Dec to observed place. The caller supplies UTC, site 

3733 coordinates, ambient air conditions and observing wavelength. 

3734 

3735 Parameters 

3736 ---------- 

3737 ri : double array 

3738 di : double array 

3739 utc1 : double array 

3740 utc2 : double array 

3741 dut1 : double array 

3742 elong : double array 

3743 phi : double array 

3744 hm : double array 

3745 xp : double array 

3746 yp : double array 

3747 phpa : double array 

3748 tc : double array 

3749 rh : double array 

3750 wl : double array 

3751 

3752 Returns 

3753 ------- 

3754 aob : double array 

3755 zob : double array 

3756 hob : double array 

3757 dob : double array 

3758 rob : double array 

3759 

3760 Notes 

3761 ----- 

3762 Wraps ERFA function ``eraAtio13``. The ERFA documentation is:: 

3763 

3764 - - - - - - - - - - 

3765 e r a A t i o 1 3 

3766 - - - - - - - - - - 

3767 

3768 CIRS RA,Dec to observed place. The caller supplies UTC, site 

3769 coordinates, ambient air conditions and observing wavelength. 

3770 

3771 Given: 

3772 ri double CIRS right ascension (CIO-based, radians) 

3773 di double CIRS declination (radians) 

3774 utc1 double UTC as a 2-part... 

3775 utc2 double ...quasi Julian Date (Notes 1,2) 

3776 dut1 double UT1-UTC (seconds, Note 3) 

3777 elong double longitude (radians, east +ve, Note 4) 

3778 phi double geodetic latitude (radians, Note 4) 

3779 hm double height above ellipsoid (m, geodetic Notes 4,6) 

3780 xp,yp double polar motion coordinates (radians, Note 5) 

3781 phpa double pressure at the observer (hPa = mB, Note 6) 

3782 tc double ambient temperature at the observer (deg C) 

3783 rh double relative humidity at the observer (range 0-1) 

3784 wl double wavelength (micrometers, Note 7) 

3785 

3786 Returned: 

3787 aob double observed azimuth (radians: N=0,E=90) 

3788 zob double observed zenith distance (radians) 

3789 hob double observed hour angle (radians) 

3790 dob double observed declination (radians) 

3791 rob double observed right ascension (CIO-based, radians) 

3792 

3793 Returned (function value): 

3794 int status: +1 = dubious year (Note 2) 

3795 0 = OK 

3796 -1 = unacceptable date 

3797 

3798 Notes: 

3799 

3800 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any 

3801 convenient way between the two arguments, for example where utc1 

3802 is the Julian Day Number and utc2 is the fraction of a day. 

3803 

3804 However, JD cannot unambiguously represent UTC during a leap 

3805 second unless special measures are taken. The convention in the 

3806 present function is that the JD day represents UTC days whether 

3807 the length is 86399, 86400 or 86401 SI seconds. 

3808 

3809 Applications should use the function eraDtf2d to convert from 

3810 calendar date and time of day into 2-part quasi Julian Date, as 

3811 it implements the leap-second-ambiguity convention just 

3812 described. 

3813 

3814 2) The warning status "dubious year" flags UTCs that predate the 

3815 introduction of the time scale or that are too far in the 

3816 future to be trusted. See eraDat for further details. 

3817 

3818 3) UT1-UTC is tabulated in IERS bulletins. It increases by exactly 

3819 one second at the end of each positive UTC leap second, 

3820 introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This 

3821 practice is under review, and in the future UT1-UTC may grow 

3822 essentially without limit. 

3823 

3824 4) The geographical coordinates are with respect to the ERFA_WGS84 

3825 reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the 

3826 longitude required by the present function is east-positive 

3827 (i.e. right-handed), in accordance with geographical convention. 

3828 

3829 5) The polar motion xp,yp can be obtained from IERS bulletins. The 

3830 values are the coordinates (in radians) of the Celestial 

3831 Intermediate Pole with respect to the International Terrestrial 

3832 Reference System (see IERS Conventions 2003), measured along the 

3833 meridians 0 and 90 deg west respectively. For many 

3834 applications, xp and yp can be set to zero. 

3835 

3836 6) If hm, the height above the ellipsoid of the observing station 

3837 in meters, is not known but phpa, the pressure in hPa (=mB), is 

3838 available, an adequate estimate of hm can be obtained from the 

3839 expression 

3840 

3841 hm = -29.3 * tsl * log ( phpa / 1013.25 ); 

3842 

3843 where tsl is the approximate sea-level air temperature in K 

3844 (See Astrophysical Quantities, C.W.Allen, 3rd edition, section 

3845 52). Similarly, if the pressure phpa is not known, it can be 

3846 estimated from the height of the observing station, hm, as 

3847 follows: 

3848 

3849 phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); 

3850 

3851 Note, however, that the refraction is nearly proportional to 

3852 the pressure and that an accurate phpa value is important for 

3853 precise work. 

3854 

3855 7) The argument wl specifies the observing wavelength in 

3856 micrometers. The transition from optical to radio is assumed to 

3857 occur at 100 micrometers (about 3000 GHz). 

3858 

3859 8) "Observed" Az,ZD means the position that would be seen by a 

3860 perfect geodetically aligned theodolite. (Zenith distance is 

3861 used rather than altitude in order to reflect the fact that no 

3862 allowance is made for depression of the horizon.) This is 

3863 related to the observed HA,Dec via the standard rotation, using 

3864 the geodetic latitude (corrected for polar motion), while the 

3865 observed HA and RA are related simply through the Earth rotation 

3866 angle and the site longitude. "Observed" RA,Dec or HA,Dec thus 

3867 means the position that would be seen by a perfect equatorial 

3868 with its polar axis aligned to the Earth's axis of rotation. 

3869 

3870 9) The accuracy of the result is limited by the corrections for 

3871 refraction, which use a simple A*tan(z) + B*tan^3(z) model. 

3872 Providing the meteorological parameters are known accurately and 

3873 there are no gross local effects, the predicted astrometric 

3874 coordinates should be within 0.05 arcsec (optical) or 1 arcsec 

3875 (radio) for a zenith distance of less than 70 degrees, better 

3876 than 30 arcsec (optical or radio) at 85 degrees and better 

3877 than 20 arcmin (optical) or 30 arcmin (radio) at the horizon. 

3878 

3879 10) The complementary functions eraAtio13 and eraAtoi13 are self- 

3880 consistent to better than 1 microarcsecond all over the 

3881 celestial sphere. 

3882 

3883 11) It is advisable to take great care with units, as even unlikely 

3884 values of the input parameters are accepted and processed in 

3885 accordance with the models used. 

3886 

3887 Called: 

3888 eraApio13 astrometry parameters, CIRS-observed, 2013 

3889 eraAtioq quick CIRS to observed 

3890 

3891 This revision: 2021 February 24 

3892 

3893 Copyright (C) 2013-2021, NumFOCUS Foundation. 

3894 Derived, with permission, from the SOFA library. See notes at end of file. 

3895 

3896 """ 

3897 aob, zob, hob, dob, rob, c_retval = ufunc.atio13( 

3898 ri, di, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) 

3899 check_errwarn(c_retval, 'atio13') 

3900 return aob, zob, hob, dob, rob 

3901 

3902 

3903STATUS_CODES['atio13'] = { 

3904 1: 'dubious year (Note 2)', 

3905 0: 'OK', 

3906 -1: 'unacceptable date', 

3907} 

3908 

3909 

3910def atioq(ri, di, astrom): 

3911 """ 

3912 Quick CIRS to observed place transformation. 

3913 

3914 Parameters 

3915 ---------- 

3916 ri : double array 

3917 di : double array 

3918 astrom : eraASTROM array 

3919 

3920 Returns 

3921 ------- 

3922 aob : double array 

3923 zob : double array 

3924 hob : double array 

3925 dob : double array 

3926 rob : double array 

3927 

3928 Notes 

3929 ----- 

3930 Wraps ERFA function ``eraAtioq``. The ERFA documentation is:: 

3931 

3932 - - - - - - - - - 

3933 e r a A t i o q 

3934 - - - - - - - - - 

3935 

3936 Quick CIRS to observed place transformation. 

3937 

3938 Use of this function is appropriate when efficiency is important and 

3939 where many star positions are all to be transformed for one date. 

3940 The star-independent astrometry parameters can be obtained by 

3941 calling eraApio[13] or eraApco[13]. 

3942 

3943 Given: 

3944 ri double CIRS right ascension 

3945 di double CIRS declination 

3946 astrom eraASTROM* star-independent astrometry parameters: 

3947 pmt double PM time interval (SSB, Julian years) 

3948 eb double[3] SSB to observer (vector, au) 

3949 eh double[3] Sun to observer (unit vector) 

3950 em double distance from Sun to observer (au) 

3951 v double[3] barycentric observer velocity (vector, c) 

3952 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

3953 bpn double[3][3] bias-precession-nutation matrix 

3954 along double longitude + s' (radians) 

3955 xpl double polar motion xp wrt local meridian (radians) 

3956 ypl double polar motion yp wrt local meridian (radians) 

3957 sphi double sine of geodetic latitude 

3958 cphi double cosine of geodetic latitude 

3959 diurab double magnitude of diurnal aberration vector 

3960 eral double "local" Earth rotation angle (radians) 

3961 refa double refraction constant A (radians) 

3962 refb double refraction constant B (radians) 

3963 

3964 Returned: 

3965 aob double observed azimuth (radians: N=0,E=90) 

3966 zob double observed zenith distance (radians) 

3967 hob double observed hour angle (radians) 

3968 dob double observed declination (radians) 

3969 rob double observed right ascension (CIO-based, radians) 

3970 

3971 Notes: 

3972 

3973 1) This function returns zenith distance rather than altitude in 

3974 order to reflect the fact that no allowance is made for 

3975 depression of the horizon. 

3976 

3977 2) The accuracy of the result is limited by the corrections for 

3978 refraction, which use a simple A*tan(z) + B*tan^3(z) model. 

3979 Providing the meteorological parameters are known accurately and 

3980 there are no gross local effects, the predicted observed 

3981 coordinates should be within 0.05 arcsec (optical) or 1 arcsec 

3982 (radio) for a zenith distance of less than 70 degrees, better 

3983 than 30 arcsec (optical or radio) at 85 degrees and better 

3984 than 20 arcmin (optical) or 30 arcmin (radio) at the horizon. 

3985 

3986 Without refraction, the complementary functions eraAtioq and 

3987 eraAtoiq are self-consistent to better than 1 microarcsecond all 

3988 over the celestial sphere. With refraction included, consistency 

3989 falls off at high zenith distances, but is still better than 

3990 0.05 arcsec at 85 degrees. 

3991 

3992 3) It is advisable to take great care with units, as even unlikely 

3993 values of the input parameters are accepted and processed in 

3994 accordance with the models used. 

3995 

3996 4) The CIRS RA,Dec is obtained from a star catalog mean place by 

3997 allowing for space motion, parallax, the Sun's gravitational lens 

3998 effect, annual aberration and precession-nutation. For star 

3999 positions in the ICRS, these effects can be applied by means of 

4000 the eraAtci13 (etc.) functions. Starting from classical "mean 

4001 place" systems, additional transformations will be needed first. 

4002 

4003 5) "Observed" Az,El means the position that would be seen by a 

4004 perfect geodetically aligned theodolite. This is obtained from 

4005 the CIRS RA,Dec by allowing for Earth orientation and diurnal 

4006 aberration, rotating from equator to horizon coordinates, and 

4007 then adjusting for refraction. The HA,Dec is obtained by 

4008 rotating back into equatorial coordinates, and is the position 

4009 that would be seen by a perfect equatorial with its polar axis 

4010 aligned to the Earth's axis of rotation. Finally, the RA is 

4011 obtained by subtracting the HA from the local ERA. 

4012 

4013 6) The star-independent CIRS-to-observed-place parameters in ASTROM 

4014 may be computed with eraApio[13] or eraApco[13]. If nothing has 

4015 changed significantly except the time, eraAper[13] may be used to 

4016 perform the requisite adjustment to the astrom structure. 

4017 

4018 Called: 

4019 eraS2c spherical coordinates to unit vector 

4020 eraC2s p-vector to spherical 

4021 eraAnp normalize angle into range 0 to 2pi 

4022 

4023 This revision: 2020 December 7 

4024 

4025 Copyright (C) 2013-2021, NumFOCUS Foundation. 

4026 Derived, with permission, from the SOFA library. See notes at end of file. 

4027 

4028 """ 

4029 aob, zob, hob, dob, rob = ufunc.atioq(ri, di, astrom) 

4030 return aob, zob, hob, dob, rob 

4031 

4032 

4033def atoc13(type, ob1, ob2, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl): 

4034 """ 

4035 Observed place at a groundbased site to to ICRS astrometric RA,Dec. 

4036 The caller supplies UTC, site coordinates, ambient air conditions 

4037 and observing wavelength. 

4038 

4039 Parameters 

4040 ---------- 

4041 type : const char array 

4042 ob1 : double array 

4043 ob2 : double array 

4044 utc1 : double array 

4045 utc2 : double array 

4046 dut1 : double array 

4047 elong : double array 

4048 phi : double array 

4049 hm : double array 

4050 xp : double array 

4051 yp : double array 

4052 phpa : double array 

4053 tc : double array 

4054 rh : double array 

4055 wl : double array 

4056 

4057 Returns 

4058 ------- 

4059 rc : double array 

4060 dc : double array 

4061 

4062 Notes 

4063 ----- 

4064 Wraps ERFA function ``eraAtoc13``. The ERFA documentation is:: 

4065 

4066 - - - - - - - - - - 

4067 e r a A t o c 1 3 

4068 - - - - - - - - - - 

4069 

4070 Observed place at a groundbased site to to ICRS astrometric RA,Dec. 

4071 The caller supplies UTC, site coordinates, ambient air conditions 

4072 and observing wavelength. 

4073 

4074 Given: 

4075 type char[] type of coordinates - "R", "H" or "A" (Notes 1,2) 

4076 ob1 double observed Az, HA or RA (radians; Az is N=0,E=90) 

4077 ob2 double observed ZD or Dec (radians) 

4078 utc1 double UTC as a 2-part... 

4079 utc2 double ...quasi Julian Date (Notes 3,4) 

4080 dut1 double UT1-UTC (seconds, Note 5) 

4081 elong double longitude (radians, east +ve, Note 6) 

4082 phi double geodetic latitude (radians, Note 6) 

4083 hm double height above ellipsoid (m, geodetic Notes 6,8) 

4084 xp,yp double polar motion coordinates (radians, Note 7) 

4085 phpa double pressure at the observer (hPa = mB, Note 8) 

4086 tc double ambient temperature at the observer (deg C) 

4087 rh double relative humidity at the observer (range 0-1) 

4088 wl double wavelength (micrometers, Note 9) 

4089 

4090 Returned: 

4091 rc,dc double ICRS astrometric RA,Dec (radians) 

4092 

4093 Returned (function value): 

4094 int status: +1 = dubious year (Note 4) 

4095 0 = OK 

4096 -1 = unacceptable date 

4097 

4098 Notes: 

4099 

4100 1) "Observed" Az,ZD means the position that would be seen by a 

4101 perfect geodetically aligned theodolite. (Zenith distance is 

4102 used rather than altitude in order to reflect the fact that no 

4103 allowance is made for depression of the horizon.) This is 

4104 related to the observed HA,Dec via the standard rotation, using 

4105 the geodetic latitude (corrected for polar motion), while the 

4106 observed HA and RA are related simply through the Earth rotation 

4107 angle and the site longitude. "Observed" RA,Dec or HA,Dec thus 

4108 means the position that would be seen by a perfect equatorial 

4109 with its polar axis aligned to the Earth's axis of rotation. 

4110 

4111 2) Only the first character of the type argument is significant. 

4112 "R" or "r" indicates that ob1 and ob2 are the observed right 

4113 ascension and declination; "H" or "h" indicates that they are 

4114 hour angle (west +ve) and declination; anything else ("A" or 

4115 "a" is recommended) indicates that ob1 and ob2 are azimuth 

4116 (north zero, east 90 deg) and zenith distance. 

4117 

4118 3) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any 

4119 convenient way between the two arguments, for example where utc1 

4120 is the Julian Day Number and utc2 is the fraction of a day. 

4121 

4122 However, JD cannot unambiguously represent UTC during a leap 

4123 second unless special measures are taken. The convention in the 

4124 present function is that the JD day represents UTC days whether 

4125 the length is 86399, 86400 or 86401 SI seconds. 

4126 

4127 Applications should use the function eraDtf2d to convert from 

4128 calendar date and time of day into 2-part quasi Julian Date, as 

4129 it implements the leap-second-ambiguity convention just 

4130 described. 

4131 

4132 4) The warning status "dubious year" flags UTCs that predate the 

4133 introduction of the time scale or that are too far in the 

4134 future to be trusted. See eraDat for further details. 

4135 

4136 5) UT1-UTC is tabulated in IERS bulletins. It increases by exactly 

4137 one second at the end of each positive UTC leap second, 

4138 introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This 

4139 practice is under review, and in the future UT1-UTC may grow 

4140 essentially without limit. 

4141 

4142 6) The geographical coordinates are with respect to the ERFA_WGS84 

4143 reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the 

4144 longitude required by the present function is east-positive 

4145 (i.e. right-handed), in accordance with geographical convention. 

4146 

4147 7) The polar motion xp,yp can be obtained from IERS bulletins. The 

4148 values are the coordinates (in radians) of the Celestial 

4149 Intermediate Pole with respect to the International Terrestrial 

4150 Reference System (see IERS Conventions 2003), measured along the 

4151 meridians 0 and 90 deg west respectively. For many 

4152 applications, xp and yp can be set to zero. 

4153 

4154 8) If hm, the height above the ellipsoid of the observing station 

4155 in meters, is not known but phpa, the pressure in hPa (=mB), is 

4156 available, an adequate estimate of hm can be obtained from the 

4157 expression 

4158 

4159 hm = -29.3 * tsl * log ( phpa / 1013.25 ); 

4160 

4161 where tsl is the approximate sea-level air temperature in K 

4162 (See Astrophysical Quantities, C.W.Allen, 3rd edition, section 

4163 52). Similarly, if the pressure phpa is not known, it can be 

4164 estimated from the height of the observing station, hm, as 

4165 follows: 

4166 

4167 phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); 

4168 

4169 Note, however, that the refraction is nearly proportional to 

4170 the pressure and that an accurate phpa value is important for 

4171 precise work. 

4172 

4173 9) The argument wl specifies the observing wavelength in 

4174 micrometers. The transition from optical to radio is assumed to 

4175 occur at 100 micrometers (about 3000 GHz). 

4176 

4177 10) The accuracy of the result is limited by the corrections for 

4178 refraction, which use a simple A*tan(z) + B*tan^3(z) model. 

4179 Providing the meteorological parameters are known accurately and 

4180 there are no gross local effects, the predicted astrometric 

4181 coordinates should be within 0.05 arcsec (optical) or 1 arcsec 

4182 (radio) for a zenith distance of less than 70 degrees, better 

4183 than 30 arcsec (optical or radio) at 85 degrees and better 

4184 than 20 arcmin (optical) or 30 arcmin (radio) at the horizon. 

4185 

4186 Without refraction, the complementary functions eraAtco13 and 

4187 eraAtoc13 are self-consistent to better than 1 microarcsecond 

4188 all over the celestial sphere. With refraction included, 

4189 consistency falls off at high zenith distances, but is still 

4190 better than 0.05 arcsec at 85 degrees. 

4191 

4192 11) It is advisable to take great care with units, as even unlikely 

4193 values of the input parameters are accepted and processed in 

4194 accordance with the models used. 

4195 

4196 Called: 

4197 eraApco13 astrometry parameters, ICRS-observed 

4198 eraAtoiq quick observed to CIRS 

4199 eraAticq quick CIRS to ICRS 

4200 

4201 This revision: 2021 February 24 

4202 

4203 Copyright (C) 2013-2021, NumFOCUS Foundation. 

4204 Derived, with permission, from the SOFA library. See notes at end of file. 

4205 

4206 """ 

4207 rc, dc, c_retval = ufunc.atoc13( 

4208 type, ob1, ob2, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) 

4209 check_errwarn(c_retval, 'atoc13') 

4210 return rc, dc 

4211 

4212 

4213STATUS_CODES['atoc13'] = { 

4214 1: 'dubious year (Note 4)', 

4215 0: 'OK', 

4216 -1: 'unacceptable date', 

4217} 

4218 

4219 

4220def atoi13(type, ob1, ob2, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl): 

4221 """ 

4222 Observed place to CIRS. The caller supplies UTC, site coordinates, 

4223 ambient air conditions and observing wavelength. 

4224 

4225 Parameters 

4226 ---------- 

4227 type : const char array 

4228 ob1 : double array 

4229 ob2 : double array 

4230 utc1 : double array 

4231 utc2 : double array 

4232 dut1 : double array 

4233 elong : double array 

4234 phi : double array 

4235 hm : double array 

4236 xp : double array 

4237 yp : double array 

4238 phpa : double array 

4239 tc : double array 

4240 rh : double array 

4241 wl : double array 

4242 

4243 Returns 

4244 ------- 

4245 ri : double array 

4246 di : double array 

4247 

4248 Notes 

4249 ----- 

4250 Wraps ERFA function ``eraAtoi13``. The ERFA documentation is:: 

4251 

4252 - - - - - - - - - - 

4253 e r a A t o i 1 3 

4254 - - - - - - - - - - 

4255 

4256 Observed place to CIRS. The caller supplies UTC, site coordinates, 

4257 ambient air conditions and observing wavelength. 

4258 

4259 Given: 

4260 type char[] type of coordinates - "R", "H" or "A" (Notes 1,2) 

4261 ob1 double observed Az, HA or RA (radians; Az is N=0,E=90) 

4262 ob2 double observed ZD or Dec (radians) 

4263 utc1 double UTC as a 2-part... 

4264 utc2 double ...quasi Julian Date (Notes 3,4) 

4265 dut1 double UT1-UTC (seconds, Note 5) 

4266 elong double longitude (radians, east +ve, Note 6) 

4267 phi double geodetic latitude (radians, Note 6) 

4268 hm double height above the ellipsoid (meters, Notes 6,8) 

4269 xp,yp double polar motion coordinates (radians, Note 7) 

4270 phpa double pressure at the observer (hPa = mB, Note 8) 

4271 tc double ambient temperature at the observer (deg C) 

4272 rh double relative humidity at the observer (range 0-1) 

4273 wl double wavelength (micrometers, Note 9) 

4274 

4275 Returned: 

4276 ri double CIRS right ascension (CIO-based, radians) 

4277 di double CIRS declination (radians) 

4278 

4279 Returned (function value): 

4280 int status: +1 = dubious year (Note 2) 

4281 0 = OK 

4282 -1 = unacceptable date 

4283 

4284 Notes: 

4285 

4286 1) "Observed" Az,ZD means the position that would be seen by a 

4287 perfect geodetically aligned theodolite. (Zenith distance is 

4288 used rather than altitude in order to reflect the fact that no 

4289 allowance is made for depression of the horizon.) This is 

4290 related to the observed HA,Dec via the standard rotation, using 

4291 the geodetic latitude (corrected for polar motion), while the 

4292 observed HA and RA are related simply through the Earth rotation 

4293 angle and the site longitude. "Observed" RA,Dec or HA,Dec thus 

4294 means the position that would be seen by a perfect equatorial 

4295 with its polar axis aligned to the Earth's axis of rotation. 

4296 

4297 2) Only the first character of the type argument is significant. 

4298 "R" or "r" indicates that ob1 and ob2 are the observed right 

4299 ascension and declination; "H" or "h" indicates that they are 

4300 hour angle (west +ve) and declination; anything else ("A" or 

4301 "a" is recommended) indicates that ob1 and ob2 are azimuth 

4302 (north zero, east 90 deg) and zenith distance. 

4303 

4304 3) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any 

4305 convenient way between the two arguments, for example where utc1 

4306 is the Julian Day Number and utc2 is the fraction of a day. 

4307 

4308 However, JD cannot unambiguously represent UTC during a leap 

4309 second unless special measures are taken. The convention in the 

4310 present function is that the JD day represents UTC days whether 

4311 the length is 86399, 86400 or 86401 SI seconds. 

4312 

4313 Applications should use the function eraDtf2d to convert from 

4314 calendar date and time of day into 2-part quasi Julian Date, as 

4315 it implements the leap-second-ambiguity convention just 

4316 described. 

4317 

4318 4) The warning status "dubious year" flags UTCs that predate the 

4319 introduction of the time scale or that are too far in the 

4320 future to be trusted. See eraDat for further details. 

4321 

4322 5) UT1-UTC is tabulated in IERS bulletins. It increases by exactly 

4323 one second at the end of each positive UTC leap second, 

4324 introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This 

4325 practice is under review, and in the future UT1-UTC may grow 

4326 essentially without limit. 

4327 

4328 6) The geographical coordinates are with respect to the ERFA_WGS84 

4329 reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the 

4330 longitude required by the present function is east-positive 

4331 (i.e. right-handed), in accordance with geographical convention. 

4332 

4333 7) The polar motion xp,yp can be obtained from IERS bulletins. The 

4334 values are the coordinates (in radians) of the Celestial 

4335 Intermediate Pole with respect to the International Terrestrial 

4336 Reference System (see IERS Conventions 2003), measured along the 

4337 meridians 0 and 90 deg west respectively. For many 

4338 applications, xp and yp can be set to zero. 

4339 

4340 8) If hm, the height above the ellipsoid of the observing station 

4341 in meters, is not known but phpa, the pressure in hPa (=mB), is 

4342 available, an adequate estimate of hm can be obtained from the 

4343 expression 

4344 

4345 hm = -29.3 * tsl * log ( phpa / 1013.25 ); 

4346 

4347 where tsl is the approximate sea-level air temperature in K 

4348 (See Astrophysical Quantities, C.W.Allen, 3rd edition, section 

4349 52). Similarly, if the pressure phpa is not known, it can be 

4350 estimated from the height of the observing station, hm, as 

4351 follows: 

4352 

4353 phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); 

4354 

4355 Note, however, that the refraction is nearly proportional to 

4356 the pressure and that an accurate phpa value is important for 

4357 precise work. 

4358 

4359 9) The argument wl specifies the observing wavelength in 

4360 micrometers. The transition from optical to radio is assumed to 

4361 occur at 100 micrometers (about 3000 GHz). 

4362 

4363 10) The accuracy of the result is limited by the corrections for 

4364 refraction, which use a simple A*tan(z) + B*tan^3(z) model. 

4365 Providing the meteorological parameters are known accurately and 

4366 there are no gross local effects, the predicted astrometric 

4367 coordinates should be within 0.05 arcsec (optical) or 1 arcsec 

4368 (radio) for a zenith distance of less than 70 degrees, better 

4369 than 30 arcsec (optical or radio) at 85 degrees and better 

4370 than 20 arcmin (optical) or 30 arcmin (radio) at the horizon. 

4371 

4372 Without refraction, the complementary functions eraAtio13 and 

4373 eraAtoi13 are self-consistent to better than 1 microarcsecond 

4374 all over the celestial sphere. With refraction included, 

4375 consistency falls off at high zenith distances, but is still 

4376 better than 0.05 arcsec at 85 degrees. 

4377 

4378 12) It is advisable to take great care with units, as even unlikely 

4379 values of the input parameters are accepted and processed in 

4380 accordance with the models used. 

4381 

4382 Called: 

4383 eraApio13 astrometry parameters, CIRS-observed, 2013 

4384 eraAtoiq quick observed to CIRS 

4385 

4386 This revision: 2021 February 24 

4387 

4388 Copyright (C) 2013-2021, NumFOCUS Foundation. 

4389 Derived, with permission, from the SOFA library. See notes at end of file. 

4390 

4391 """ 

4392 ri, di, c_retval = ufunc.atoi13( 

4393 type, ob1, ob2, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) 

4394 check_errwarn(c_retval, 'atoi13') 

4395 return ri, di 

4396 

4397 

4398STATUS_CODES['atoi13'] = { 

4399 1: 'dubious year (Note 2)', 

4400 0: 'OK', 

4401 -1: 'unacceptable date', 

4402} 

4403 

4404 

4405def atoiq(type, ob1, ob2, astrom): 

4406 """ 

4407 Quick observed place to CIRS, given the star-independent astrometry 

4408 parameters. 

4409 

4410 Parameters 

4411 ---------- 

4412 type : const char array 

4413 ob1 : double array 

4414 ob2 : double array 

4415 astrom : eraASTROM array 

4416 

4417 Returns 

4418 ------- 

4419 ri : double array 

4420 di : double array 

4421 

4422 Notes 

4423 ----- 

4424 Wraps ERFA function ``eraAtoiq``. The ERFA documentation is:: 

4425 

4426 - - - - - - - - - 

4427 e r a A t o i q 

4428 - - - - - - - - - 

4429 

4430 Quick observed place to CIRS, given the star-independent astrometry 

4431 parameters. 

4432 

4433 Use of this function is appropriate when efficiency is important and 

4434 where many star positions are all to be transformed for one date. 

4435 The star-independent astrometry parameters can be obtained by 

4436 calling eraApio[13] or eraApco[13]. 

4437 

4438 Given: 

4439 type char[] type of coordinates: "R", "H" or "A" (Note 1) 

4440 ob1 double observed Az, HA or RA (radians; Az is N=0,E=90) 

4441 ob2 double observed ZD or Dec (radians) 

4442 astrom eraASTROM* star-independent astrometry parameters: 

4443 pmt double PM time interval (SSB, Julian years) 

4444 eb double[3] SSB to observer (vector, au) 

4445 eh double[3] Sun to observer (unit vector) 

4446 em double distance from Sun to observer (au) 

4447 v double[3] barycentric observer velocity (vector, c) 

4448 bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor 

4449 bpn double[3][3] bias-precession-nutation matrix 

4450 along double longitude + s' (radians) 

4451 xpl double polar motion xp wrt local meridian (radians) 

4452 ypl double polar motion yp wrt local meridian (radians) 

4453 sphi double sine of geodetic latitude 

4454 cphi double cosine of geodetic latitude 

4455 diurab double magnitude of diurnal aberration vector 

4456 eral double "local" Earth rotation angle (radians) 

4457 refa double refraction constant A (radians) 

4458 refb double refraction constant B (radians) 

4459 

4460 Returned: 

4461 ri double CIRS right ascension (CIO-based, radians) 

4462 di double CIRS declination (radians) 

4463 

4464 Notes: 

4465 

4466 1) "Observed" Az,El means the position that would be seen by a 

4467 perfect geodetically aligned theodolite. This is related to 

4468 the observed HA,Dec via the standard rotation, using the geodetic 

4469 latitude (corrected for polar motion), while the observed HA and 

4470 RA are related simply through the Earth rotation angle and the 

4471 site longitude. "Observed" RA,Dec or HA,Dec thus means the 

4472 position that would be seen by a perfect equatorial with its 

4473 polar axis aligned to the Earth's axis of rotation. By removing 

4474 from the observed place the effects of atmospheric refraction and 

4475 diurnal aberration, the CIRS RA,Dec is obtained. 

4476 

4477 2) Only the first character of the type argument is significant. 

4478 "R" or "r" indicates that ob1 and ob2 are the observed right 

4479 ascension and declination; "H" or "h" indicates that they are 

4480 hour angle (west +ve) and declination; anything else ("A" or 

4481 "a" is recommended) indicates that ob1 and ob2 are azimuth (north 

4482 zero, east 90 deg) and zenith distance. (Zenith distance is used 

4483 rather than altitude in order to reflect the fact that no 

4484 allowance is made for depression of the horizon.) 

4485 

4486 3) The accuracy of the result is limited by the corrections for 

4487 refraction, which use a simple A*tan(z) + B*tan^3(z) model. 

4488 Providing the meteorological parameters are known accurately and 

4489 there are no gross local effects, the predicted intermediate 

4490 coordinates should be within 0.05 arcsec (optical) or 1 arcsec 

4491 (radio) for a zenith distance of less than 70 degrees, better 

4492 than 30 arcsec (optical or radio) at 85 degrees and better than 

4493 20 arcmin (optical) or 25 arcmin (radio) at the horizon. 

4494 

4495 Without refraction, the complementary functions eraAtioq and 

4496 eraAtoiq are self-consistent to better than 1 microarcsecond all 

4497 over the celestial sphere. With refraction included, consistency 

4498 falls off at high zenith distances, but is still better than 

4499 0.05 arcsec at 85 degrees. 

4500 

4501 4) It is advisable to take great care with units, as even unlikely 

4502 values of the input parameters are accepted and processed in 

4503 accordance with the models used. 

4504 

4505 Called: 

4506 eraS2c spherical coordinates to unit vector 

4507 eraC2s p-vector to spherical 

4508 eraAnp normalize angle into range 0 to 2pi 

4509 

4510 This revision: 2020 December 7 

4511 

4512 Copyright (C) 2013-2021, NumFOCUS Foundation. 

4513 Derived, with permission, from the SOFA library. See notes at end of file. 

4514 

4515 """ 

4516 ri, di = ufunc.atoiq(type, ob1, ob2, astrom) 

4517 return ri, di 

4518 

4519 

4520def ld(bm, p, q, e, em, dlim): 

4521 """ 

4522 Apply light deflection by a solar-system body, as part of 

4523 transforming coordinate direction into natural direction. 

4524 

4525 Parameters 

4526 ---------- 

4527 bm : double array 

4528 p : double array 

4529 q : double array 

4530 e : double array 

4531 em : double array 

4532 dlim : double array 

4533 

4534 Returns 

4535 ------- 

4536 p1 : double array 

4537 

4538 Notes 

4539 ----- 

4540 Wraps ERFA function ``eraLd``. The ERFA documentation is:: 

4541 

4542 - - - - - - 

4543 e r a L d 

4544 - - - - - - 

4545 

4546 Apply light deflection by a solar-system body, as part of 

4547 transforming coordinate direction into natural direction. 

4548 

4549 Given: 

4550 bm double mass of the gravitating body (solar masses) 

4551 p double[3] direction from observer to source (unit vector) 

4552 q double[3] direction from body to source (unit vector) 

4553 e double[3] direction from body to observer (unit vector) 

4554 em double distance from body to observer (au) 

4555 dlim double deflection limiter (Note 4) 

4556 

4557 Returned: 

4558 p1 double[3] observer to deflected source (unit vector) 

4559 

4560 Notes: 

4561 

4562 1) The algorithm is based on Expr. (70) in Klioner (2003) and 

4563 Expr. (7.63) in the Explanatory Supplement (Urban & Seidelmann 

4564 2013), with some rearrangement to minimize the effects of machine 

4565 precision. 

4566 

4567 2) The mass parameter bm can, as required, be adjusted in order to 

4568 allow for such effects as quadrupole field. 

4569 

4570 3) The barycentric position of the deflecting body should ideally 

4571 correspond to the time of closest approach of the light ray to 

4572 the body. 

4573 

4574 4) The deflection limiter parameter dlim is phi^2/2, where phi is 

4575 the angular separation (in radians) between source and body at 

4576 which limiting is applied. As phi shrinks below the chosen 

4577 threshold, the deflection is artificially reduced, reaching zero 

4578 for phi = 0. 

4579 

4580 5) The returned vector p1 is not normalized, but the consequential 

4581 departure from unit magnitude is always negligible. 

4582 

4583 6) The arguments p and p1 can be the same array. 

4584 

4585 7) To accumulate total light deflection taking into account the 

4586 contributions from several bodies, call the present function for 

4587 each body in succession, in decreasing order of distance from the 

4588 observer. 

4589 

4590 8) For efficiency, validation is omitted. The supplied vectors must 

4591 be of unit magnitude, and the deflection limiter non-zero and 

4592 positive. 

4593 

4594 References: 

4595 

4596 Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to 

4597 the Astronomical Almanac, 3rd ed., University Science Books 

4598 (2013). 

4599 

4600 Klioner, Sergei A., "A practical relativistic model for micro- 

4601 arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003). 

4602 

4603 Called: 

4604 eraPdp scalar product of two p-vectors 

4605 eraPxp vector product of two p-vectors 

4606 

4607 This revision: 2021 February 24 

4608 

4609 Copyright (C) 2013-2021, NumFOCUS Foundation. 

4610 Derived, with permission, from the SOFA library. See notes at end of file. 

4611 

4612 """ 

4613 p1 = ufunc.ld(bm, p, q, e, em, dlim) 

4614 return p1 

4615 

4616 

4617def ldn(b, ob, sc): 

4618 """ 

4619 For a star, apply light deflection by multiple solar-system bodies, 

4620 as part of transforming coordinate direction into natural direction. 

4621 

4622 Parameters 

4623 ---------- 

4624 b : eraLDBODY array 

4625 ob : double array 

4626 sc : double array 

4627 

4628 Returns 

4629 ------- 

4630 sn : double array 

4631 

4632 Notes 

4633 ----- 

4634 Wraps ERFA function ``eraLdn``. The ERFA documentation is:: 

4635 

4636 - - - - - - - 

4637 e r a L d n 

4638 - - - - - - - 

4639 

4640 For a star, apply light deflection by multiple solar-system bodies, 

4641 as part of transforming coordinate direction into natural direction. 

4642 

4643 Given: 

4644 n int number of bodies (note 1) 

4645 b eraLDBODY[n] data for each of the n bodies (Notes 1,2): 

4646 bm double mass of the body (solar masses, Note 3) 

4647 dl double deflection limiter (Note 4) 

4648 pv [2][3] barycentric PV of the body (au, au/day) 

4649 ob double[3] barycentric position of the observer (au) 

4650 sc double[3] observer to star coord direction (unit vector) 

4651 

4652 Returned: 

4653 sn double[3] observer to deflected star (unit vector) 

4654 

4655 1) The array b contains n entries, one for each body to be 

4656 considered. If n = 0, no gravitational light deflection will be 

4657 applied, not even for the Sun. 

4658 

4659 2) The array b should include an entry for the Sun as well as for 

4660 any planet or other body to be taken into account. The entries 

4661 should be in the order in which the light passes the body. 

4662 

4663 3) In the entry in the b array for body i, the mass parameter 

4664 b[i].bm can, as required, be adjusted in order to allow for such 

4665 effects as quadrupole field. 

4666 

4667 4) The deflection limiter parameter b[i].dl is phi^2/2, where phi is 

4668 the angular separation (in radians) between star and body at 

4669 which limiting is applied. As phi shrinks below the chosen 

4670 threshold, the deflection is artificially reduced, reaching zero 

4671 for phi = 0. Example values suitable for a terrestrial 

4672 observer, together with masses, are as follows: 

4673 

4674 body i b[i].bm b[i].dl 

4675 

4676 Sun 1.0 6e-6 

4677 Jupiter 0.00095435 3e-9 

4678 Saturn 0.00028574 3e-10 

4679 

4680 5) For cases where the starlight passes the body before reaching the 

4681 observer, the body is placed back along its barycentric track by 

4682 the light time from that point to the observer. For cases where 

4683 the body is "behind" the observer no such shift is applied. If 

4684 a different treatment is preferred, the user has the option of 

4685 instead using the eraLd function. Similarly, eraLd can be used 

4686 for cases where the source is nearby, not a star. 

4687 

4688 6) The returned vector sn is not normalized, but the consequential 

4689 departure from unit magnitude is always negligible. 

4690 

4691 7) The arguments sc and sn can be the same array. 

4692 

4693 8) For efficiency, validation is omitted. The supplied masses must 

4694 be greater than zero, the position and velocity vectors must be 

4695 right, and the deflection limiter greater than zero. 

4696 

4697 Reference: 

4698 

4699 Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to 

4700 the Astronomical Almanac, 3rd ed., University Science Books 

4701 (2013), Section 7.2.4. 

4702 

4703 Called: 

4704 eraCp copy p-vector 

4705 eraPdp scalar product of two p-vectors 

4706 eraPmp p-vector minus p-vector 

4707 eraPpsp p-vector plus scaled p-vector 

4708 eraPn decompose p-vector into modulus and direction 

4709 eraLd light deflection by a solar-system body 

4710 

4711 This revision: 2021 February 24 

4712 

4713 Copyright (C) 2013-2021, NumFOCUS Foundation. 

4714 Derived, with permission, from the SOFA library. See notes at end of file. 

4715 

4716 """ 

4717 sn = ufunc.ldn(b, ob, sc) 

4718 return sn 

4719 

4720 

4721def ldsun(p, e, em): 

4722 """ 

4723 Deflection of starlight by the Sun. 

4724 

4725 Parameters 

4726 ---------- 

4727 p : double array 

4728 e : double array 

4729 em : double array 

4730 

4731 Returns 

4732 ------- 

4733 p1 : double array 

4734 

4735 Notes 

4736 ----- 

4737 Wraps ERFA function ``eraLdsun``. The ERFA documentation is:: 

4738 

4739 - - - - - - - - - 

4740 e r a L d s u n 

4741 - - - - - - - - - 

4742 

4743 Deflection of starlight by the Sun. 

4744 

4745 Given: 

4746 p double[3] direction from observer to star (unit vector) 

4747 e double[3] direction from Sun to observer (unit vector) 

4748 em double distance from Sun to observer (au) 

4749 

4750 Returned: 

4751 p1 double[3] observer to deflected star (unit vector) 

4752 

4753 Notes: 

4754 

4755 1) The source is presumed to be sufficiently distant that its 

4756 directions seen from the Sun and the observer are essentially 

4757 the same. 

4758 

4759 2) The deflection is restrained when the angle between the star and 

4760 the center of the Sun is less than a threshold value, falling to 

4761 zero deflection for zero separation. The chosen threshold value 

4762 is within the solar limb for all solar-system applications, and 

4763 is about 5 arcminutes for the case of a terrestrial observer. 

4764 

4765 3) The arguments p and p1 can be the same array. 

4766 

4767 Called: 

4768 eraLd light deflection by a solar-system body 

4769 

4770 This revision: 2016 June 16 

4771 

4772 Copyright (C) 2013-2021, NumFOCUS Foundation. 

4773 Derived, with permission, from the SOFA library. See notes at end of file. 

4774 

4775 """ 

4776 p1 = ufunc.ldsun(p, e, em) 

4777 return p1 

4778 

4779 

4780def pmpx(rc, dc, pr, pd, px, rv, pmt, pob): 

4781 """ 

4782 Proper motion and parallax. 

4783 

4784 Parameters 

4785 ---------- 

4786 rc : double array 

4787 dc : double array 

4788 pr : double array 

4789 pd : double array 

4790 px : double array 

4791 rv : double array 

4792 pmt : double array 

4793 pob : double array 

4794 

4795 Returns 

4796 ------- 

4797 pco : double array 

4798 

4799 Notes 

4800 ----- 

4801 Wraps ERFA function ``eraPmpx``. The ERFA documentation is:: 

4802 

4803 - - - - - - - - 

4804 e r a P m p x 

4805 - - - - - - - - 

4806 

4807 Proper motion and parallax. 

4808 

4809 Given: 

4810 rc,dc double ICRS RA,Dec at catalog epoch (radians) 

4811 pr double RA proper motion (radians/year, Note 1) 

4812 pd double Dec proper motion (radians/year) 

4813 px double parallax (arcsec) 

4814 rv double radial velocity (km/s, +ve if receding) 

4815 pmt double proper motion time interval (SSB, Julian years) 

4816 pob double[3] SSB to observer vector (au) 

4817 

4818 Returned: 

4819 pco double[3] coordinate direction (BCRS unit vector) 

4820 

4821 Notes: 

4822 

4823 1) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. 

4824 

4825 2) The proper motion time interval is for when the starlight 

4826 reaches the solar system barycenter. 

4827 

4828 3) To avoid the need for iteration, the Roemer effect (i.e. the 

4829 small annual modulation of the proper motion coming from the 

4830 changing light time) is applied approximately, using the 

4831 direction of the star at the catalog epoch. 

4832 

4833 References: 

4834 

4835 1984 Astronomical Almanac, pp B39-B41. 

4836 

4837 Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to 

4838 the Astronomical Almanac, 3rd ed., University Science Books 

4839 (2013), Section 7.2. 

4840 

4841 Called: 

4842 eraPdp scalar product of two p-vectors 

4843 eraPn decompose p-vector into modulus and direction 

4844 

4845 This revision: 2021 April 3 

4846 

4847 Copyright (C) 2013-2021, NumFOCUS Foundation. 

4848 Derived, with permission, from the SOFA library. See notes at end of file. 

4849 

4850 """ 

4851 pco = ufunc.pmpx(rc, dc, pr, pd, px, rv, pmt, pob) 

4852 return pco 

4853 

4854 

4855def pmsafe(ra1, dec1, pmr1, pmd1, px1, rv1, ep1a, ep1b, ep2a, ep2b): 

4856 """ 

4857 Star proper motion: update star catalog data for space motion, with 

4858 special handling to handle the zero parallax case. 

4859 

4860 Parameters 

4861 ---------- 

4862 ra1 : double array 

4863 dec1 : double array 

4864 pmr1 : double array 

4865 pmd1 : double array 

4866 px1 : double array 

4867 rv1 : double array 

4868 ep1a : double array 

4869 ep1b : double array 

4870 ep2a : double array 

4871 ep2b : double array 

4872 

4873 Returns 

4874 ------- 

4875 ra2 : double array 

4876 dec2 : double array 

4877 pmr2 : double array 

4878 pmd2 : double array 

4879 px2 : double array 

4880 rv2 : double array 

4881 

4882 Notes 

4883 ----- 

4884 Wraps ERFA function ``eraPmsafe``. The ERFA documentation is:: 

4885 

4886 - - - - - - - - - - 

4887 e r a P m s a f e 

4888 - - - - - - - - - - 

4889 

4890 Star proper motion: update star catalog data for space motion, with 

4891 special handling to handle the zero parallax case. 

4892 

4893 Given: 

4894 ra1 double right ascension (radians), before 

4895 dec1 double declination (radians), before 

4896 pmr1 double RA proper motion (radians/year), before 

4897 pmd1 double Dec proper motion (radians/year), before 

4898 px1 double parallax (arcseconds), before 

4899 rv1 double radial velocity (km/s, +ve = receding), before 

4900 ep1a double "before" epoch, part A (Note 1) 

4901 ep1b double "before" epoch, part B (Note 1) 

4902 ep2a double "after" epoch, part A (Note 1) 

4903 ep2b double "after" epoch, part B (Note 1) 

4904 

4905 Returned: 

4906 ra2 double right ascension (radians), after 

4907 dec2 double declination (radians), after 

4908 pmr2 double RA proper motion (radians/year), after 

4909 pmd2 double Dec proper motion (radians/year), after 

4910 px2 double parallax (arcseconds), after 

4911 rv2 double radial velocity (km/s, +ve = receding), after 

4912 

4913 Returned (function value): 

4914 int status: 

4915 -1 = system error (should not occur) 

4916 0 = no warnings or errors 

4917 1 = distance overridden (Note 6) 

4918 2 = excessive velocity (Note 7) 

4919 4 = solution didn't converge (Note 8) 

4920 else = binary logical OR of the above warnings 

4921 

4922 Notes: 

4923 

4924 1) The starting and ending TDB epochs ep1a+ep1b and ep2a+ep2b are 

4925 Julian Dates, apportioned in any convenient way between the two 

4926 parts (A and B). For example, JD(TDB)=2450123.7 could be 

4927 expressed in any of these ways, among others: 

4928 

4929 epNa epNb 

4930 

4931 2450123.7 0.0 (JD method) 

4932 2451545.0 -1421.3 (J2000 method) 

4933 2400000.5 50123.2 (MJD method) 

4934 2450123.5 0.2 (date & time method) 

4935 

4936 The JD method is the most natural and convenient to use in cases 

4937 where the loss of several decimal digits of resolution is 

4938 acceptable. The J2000 method is best matched to the way the 

4939 argument is handled internally and will deliver the optimum 

4940 resolution. The MJD method and the date & time methods are both 

4941 good compromises between resolution and convenience. 

4942 

4943 2) In accordance with normal star-catalog conventions, the object's 

4944 right ascension and declination are freed from the effects of 

4945 secular aberration. The frame, which is aligned to the catalog 

4946 equator and equinox, is Lorentzian and centered on the SSB. 

4947 

4948 The proper motions are the rate of change of the right ascension 

4949 and declination at the catalog epoch and are in radians per TDB 

4950 Julian year. 

4951 

4952 The parallax and radial velocity are in the same frame. 

4953 

4954 3) Care is needed with units. The star coordinates are in radians 

4955 and the proper motions in radians per Julian year, but the 

4956 parallax is in arcseconds. 

4957 

4958 4) The RA proper motion is in terms of coordinate angle, not true 

4959 angle. If the catalog uses arcseconds for both RA and Dec proper 

4960 motions, the RA proper motion will need to be divided by cos(Dec) 

4961 before use. 

4962 

4963 5) Straight-line motion at constant speed, in the inertial frame, is 

4964 assumed. 

4965 

4966 6) An extremely small (or zero or negative) parallax is overridden 

4967 to ensure that the object is at a finite but very large distance, 

4968 but not so large that the proper motion is equivalent to a large 

4969 but safe speed (about 0.1c using the chosen constant). A warning 

4970 status of 1 is added to the status if this action has been taken. 

4971 

4972 7) If the space velocity is a significant fraction of c (see the 

4973 constant VMAX in the function eraStarpv), it is arbitrarily set 

4974 to zero. When this action occurs, 2 is added to the status. 

4975 

4976 8) The relativistic adjustment carried out in the eraStarpv function 

4977 involves an iterative calculation. If the process fails to 

4978 converge within a set number of iterations, 4 is added to the 

4979 status. 

4980 

4981 Called: 

4982 eraSeps angle between two points 

4983 eraStarpm update star catalog data for space motion 

4984 

4985 This revision: 2014 July 1 

4986 

4987 Copyright (C) 2013-2021, NumFOCUS Foundation. 

4988 Derived, with permission, from the SOFA library. See notes at end of file. 

4989 

4990 """ 

4991 ra2, dec2, pmr2, pmd2, px2, rv2, c_retval = ufunc.pmsafe( 

4992 ra1, dec1, pmr1, pmd1, px1, rv1, ep1a, ep1b, ep2a, ep2b) 

4993 check_errwarn(c_retval, 'pmsafe') 

4994 return ra2, dec2, pmr2, pmd2, px2, rv2 

4995 

4996 

4997STATUS_CODES['pmsafe'] = { 

4998 -1: 'system error (should not occur)', 

4999 0: 'no warnings or errors', 

5000 1: 'distance overridden (Note 6)', 

5001 2: 'excessive velocity (Note 7)', 

5002 4: "solution didn't converge (Note 8)", 

5003 'else': 'binary logical OR of the above warnings', 

5004} 

5005 

5006 

5007def pvtob(elong, phi, hm, xp, yp, sp, theta): 

5008 """ 

5009 Position and velocity of a terrestrial observing station. 

5010 

5011 Parameters 

5012 ---------- 

5013 elong : double array 

5014 phi : double array 

5015 hm : double array 

5016 xp : double array 

5017 yp : double array 

5018 sp : double array 

5019 theta : double array 

5020 

5021 Returns 

5022 ------- 

5023 pv : double array 

5024 

5025 Notes 

5026 ----- 

5027 Wraps ERFA function ``eraPvtob``. The ERFA documentation is:: 

5028 

5029 - - - - - - - - - 

5030 e r a P v t o b 

5031 - - - - - - - - - 

5032 

5033 Position and velocity of a terrestrial observing station. 

5034 

5035 Given: 

5036 elong double longitude (radians, east +ve, Note 1) 

5037 phi double latitude (geodetic, radians, Note 1) 

5038 hm double height above ref. ellipsoid (geodetic, m) 

5039 xp,yp double coordinates of the pole (radians, Note 2) 

5040 sp double the TIO locator s' (radians, Note 2) 

5041 theta double Earth rotation angle (radians, Note 3) 

5042 

5043 Returned: 

5044 pv double[2][3] position/velocity vector (m, m/s, CIRS) 

5045 

5046 Notes: 

5047 

5048 1) The terrestrial coordinates are with respect to the ERFA_WGS84 

5049 reference ellipsoid. 

5050 

5051 2) xp and yp are the coordinates (in radians) of the Celestial 

5052 Intermediate Pole with respect to the International Terrestrial 

5053 Reference System (see IERS Conventions), measured along the 

5054 meridians 0 and 90 deg west respectively. sp is the TIO locator 

5055 s', in radians, which positions the Terrestrial Intermediate 

5056 Origin on the equator. For many applications, xp, yp and 

5057 (especially) sp can be set to zero. 

5058 

5059 3) If theta is Greenwich apparent sidereal time instead of Earth 

5060 rotation angle, the result is with respect to the true equator 

5061 and equinox of date, i.e. with the x-axis at the equinox rather 

5062 than the celestial intermediate origin. 

5063 

5064 4) The velocity units are meters per UT1 second, not per SI second. 

5065 This is unlikely to have any practical consequences in the modern 

5066 era. 

5067 

5068 5) No validation is performed on the arguments. Error cases that 

5069 could lead to arithmetic exceptions are trapped by the eraGd2gc 

5070 function, and the result set to zeros. 

5071 

5072 References: 

5073 

5074 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

5075 IERS Technical Note No. 32, BKG (2004) 

5076 

5077 Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to 

5078 the Astronomical Almanac, 3rd ed., University Science Books 

5079 (2013), Section 7.4.3.3. 

5080 

5081 Called: 

5082 eraGd2gc geodetic to geocentric transformation 

5083 eraPom00 polar motion matrix 

5084 eraTrxp product of transpose of r-matrix and p-vector 

5085 

5086 This revision: 2021 February 24 

5087 

5088 Copyright (C) 2013-2021, NumFOCUS Foundation. 

5089 Derived, with permission, from the SOFA library. See notes at end of file. 

5090 

5091 """ 

5092 pv = ufunc.pvtob(elong, phi, hm, xp, yp, sp, theta) 

5093 return pv 

5094 

5095 

5096def refco(phpa, tc, rh, wl): 

5097 """ 

5098 Determine the constants A and B in the atmospheric refraction model 

5099 dZ = A tan Z + B tan^3 Z. 

5100 

5101 Parameters 

5102 ---------- 

5103 phpa : double array 

5104 tc : double array 

5105 rh : double array 

5106 wl : double array 

5107 

5108 Returns 

5109 ------- 

5110 refa : double array 

5111 refb : double array 

5112 

5113 Notes 

5114 ----- 

5115 Wraps ERFA function ``eraRefco``. The ERFA documentation is:: 

5116 

5117 - - - - - - - - - 

5118 e r a R e f c o 

5119 - - - - - - - - - 

5120 

5121 Determine the constants A and B in the atmospheric refraction model 

5122 dZ = A tan Z + B tan^3 Z. 

5123 

5124 Z is the "observed" zenith distance (i.e. affected by refraction) 

5125 and dZ is what to add to Z to give the "topocentric" (i.e. in vacuo) 

5126 zenith distance. 

5127 

5128 Given: 

5129 phpa double pressure at the observer (hPa = millibar) 

5130 tc double ambient temperature at the observer (deg C) 

5131 rh double relative humidity at the observer (range 0-1) 

5132 wl double wavelength (micrometers) 

5133 

5134 Returned: 

5135 refa double tan Z coefficient (radians) 

5136 refb double tan^3 Z coefficient (radians) 

5137 

5138 Notes: 

5139 

5140 1) The model balances speed and accuracy to give good results in 

5141 applications where performance at low altitudes is not paramount. 

5142 Performance is maintained across a range of conditions, and 

5143 applies to both optical/IR and radio. 

5144 

5145 2) The model omits the effects of (i) height above sea level (apart 

5146 from the reduced pressure itself), (ii) latitude (i.e. the 

5147 flattening of the Earth), (iii) variations in tropospheric lapse 

5148 rate and (iv) dispersive effects in the radio. 

5149 

5150 The model was tested using the following range of conditions: 

5151 

5152 lapse rates 0.0055, 0.0065, 0.0075 deg/meter 

5153 latitudes 0, 25, 50, 75 degrees 

5154 heights 0, 2500, 5000 meters ASL 

5155 pressures mean for height -10% to +5% in steps of 5% 

5156 temperatures -10 deg to +20 deg with respect to 280 deg at SL 

5157 relative humidity 0, 0.5, 1 

5158 wavelengths 0.4, 0.6, ... 2 micron, + radio 

5159 zenith distances 15, 45, 75 degrees 

5160 

5161 The accuracy with respect to raytracing through a model 

5162 atmosphere was as follows: 

5163 

5164 worst RMS 

5165 

5166 optical/IR 62 mas 8 mas 

5167 radio 319 mas 49 mas 

5168 

5169 For this particular set of conditions: 

5170 

5171 lapse rate 0.0065 K/meter 

5172 latitude 50 degrees 

5173 sea level 

5174 pressure 1005 mb 

5175 temperature 280.15 K 

5176 humidity 80% 

5177 wavelength 5740 Angstroms 

5178 

5179 the results were as follows: 

5180 

5181 ZD raytrace eraRefco Saastamoinen 

5182 

5183 10 10.27 10.27 10.27 

5184 20 21.19 21.20 21.19 

5185 30 33.61 33.61 33.60 

5186 40 48.82 48.83 48.81 

5187 45 58.16 58.18 58.16 

5188 50 69.28 69.30 69.27 

5189 55 82.97 82.99 82.95 

5190 60 100.51 100.54 100.50 

5191 65 124.23 124.26 124.20 

5192 70 158.63 158.68 158.61 

5193 72 177.32 177.37 177.31 

5194 74 200.35 200.38 200.32 

5195 76 229.45 229.43 229.42 

5196 78 267.44 267.29 267.41 

5197 80 319.13 318.55 319.10 

5198 

5199 deg arcsec arcsec arcsec 

5200 

5201 The values for Saastamoinen's formula (which includes terms 

5202 up to tan^5) are taken from Hohenkerk and Sinclair (1985). 

5203 

5204 3) A wl value in the range 0-100 selects the optical/IR case and is 

5205 wavelength in micrometers. Any value outside this range selects 

5206 the radio case. 

5207 

5208 4) Outlandish input parameters are silently limited to 

5209 mathematically safe values. Zero pressure is permissible, and 

5210 causes zeroes to be returned. 

5211 

5212 5) The algorithm draws on several sources, as follows: 

5213 

5214 a) The formula for the saturation vapour pressure of water as 

5215 a function of temperature and temperature is taken from 

5216 Equations (A4.5-A4.7) of Gill (1982). 

5217 

5218 b) The formula for the water vapour pressure, given the 

5219 saturation pressure and the relative humidity, is from 

5220 Crane (1976), Equation (2.5.5). 

5221 

5222 c) The refractivity of air is a function of temperature, 

5223 total pressure, water-vapour pressure and, in the case 

5224 of optical/IR, wavelength. The formulae for the two cases are 

5225 developed from Hohenkerk & Sinclair (1985) and Rueger (2002). 

5226 The IAG (1999) optical refractivity for dry air is used. 

5227 

5228 d) The formula for beta, the ratio of the scale height of the 

5229 atmosphere to the geocentric distance of the observer, is 

5230 an adaption of Equation (9) from Stone (1996). The 

5231 adaptations, arrived at empirically, consist of (i) a small 

5232 adjustment to the coefficient and (ii) a humidity term for the 

5233 radio case only. 

5234 

5235 e) The formulae for the refraction constants as a function of 

5236 n-1 and beta are from Green (1987), Equation (4.31). 

5237 

5238 References: 

5239 

5240 Crane, R.K., Meeks, M.L. (ed), "Refraction Effects in the Neutral 

5241 Atmosphere", Methods of Experimental Physics: Astrophysics 12B, 

5242 Academic Press, 1976. 

5243 

5244 Gill, Adrian E., "Atmosphere-Ocean Dynamics", Academic Press, 

5245 1982. 

5246 

5247 Green, R.M., "Spherical Astronomy", Cambridge University Press, 

5248 1987. 

5249 

5250 Hohenkerk, C.Y., & Sinclair, A.T., NAO Technical Note No. 63, 

5251 1985. 

5252 

5253 IAG Resolutions adopted at the XXIIth General Assembly in 

5254 Birmingham, 1999, Resolution 3. 

5255 

5256 Rueger, J.M., "Refractive Index Formulae for Electronic Distance 

5257 Measurement with Radio and Millimetre Waves", in Unisurv Report 

5258 S-68, School of Surveying and Spatial Information Systems, 

5259 University of New South Wales, Sydney, Australia, 2002. 

5260 

5261 Stone, Ronald C., P.A.S.P. 108, 1051-1058, 1996. 

5262 

5263 This revision: 2021 February 24 

5264 

5265 Copyright (C) 2013-2021, NumFOCUS Foundation. 

5266 Derived, with permission, from the SOFA library. See notes at end of file. 

5267 

5268 """ 

5269 refa, refb = ufunc.refco(phpa, tc, rh, wl) 

5270 return refa, refb 

5271 

5272 

5273def epv00(date1, date2): 

5274 """ 

5275 Earth position and velocity, heliocentric and barycentric, with 

5276 respect to the Barycentric Celestial Reference System. 

5277 

5278 Parameters 

5279 ---------- 

5280 date1 : double array 

5281 date2 : double array 

5282 

5283 Returns 

5284 ------- 

5285 pvh : double array 

5286 pvb : double array 

5287 

5288 Notes 

5289 ----- 

5290 Wraps ERFA function ``eraEpv00``. The ERFA documentation is:: 

5291 

5292 - - - - - - - - - 

5293 e r a E p v 0 0 

5294 - - - - - - - - - 

5295 

5296 Earth position and velocity, heliocentric and barycentric, with 

5297 respect to the Barycentric Celestial Reference System. 

5298 

5299 Given: 

5300 date1,date2 double TDB date (Note 1) 

5301 

5302 Returned: 

5303 pvh double[2][3] heliocentric Earth position/velocity 

5304 pvb double[2][3] barycentric Earth position/velocity 

5305 

5306 Returned (function value): 

5307 int status: 0 = OK 

5308 +1 = warning: date outside 

5309 the range 1900-2100 AD 

5310 

5311 Notes: 

5312 

5313 1) The TDB date date1+date2 is a Julian Date, apportioned in any 

5314 convenient way between the two arguments. For example, 

5315 JD(TDB)=2450123.7 could be expressed in any of these ways, among 

5316 others: 

5317 

5318 date1 date2 

5319 

5320 2450123.7 0.0 (JD method) 

5321 2451545.0 -1421.3 (J2000 method) 

5322 2400000.5 50123.2 (MJD method) 

5323 2450123.5 0.2 (date & time method) 

5324 

5325 The JD method is the most natural and convenient to use in cases 

5326 where the loss of several decimal digits of resolution is 

5327 acceptable. The J2000 method is best matched to the way the 

5328 argument is handled internally and will deliver the optimum 

5329 resolution. The MJD method and the date & time methods are both 

5330 good compromises between resolution and convenience. However, 

5331 the accuracy of the result is more likely to be limited by the 

5332 algorithm itself than the way the date has been expressed. 

5333 

5334 n.b. TT can be used instead of TDB in most applications. 

5335 

5336 2) On return, the arrays pvh and pvb contain the following: 

5337 

5338 pvh[0][0] x } 

5339 pvh[0][1] y } heliocentric position, au 

5340 pvh[0][2] z } 

5341 

5342 pvh[1][0] xdot } 

5343 pvh[1][1] ydot } heliocentric velocity, au/d 

5344 pvh[1][2] zdot } 

5345 

5346 pvb[0][0] x } 

5347 pvb[0][1] y } barycentric position, au 

5348 pvb[0][2] z } 

5349 

5350 pvb[1][0] xdot } 

5351 pvb[1][1] ydot } barycentric velocity, au/d 

5352 pvb[1][2] zdot } 

5353 

5354 The vectors are with respect to the Barycentric Celestial 

5355 Reference System. The time unit is one day in TDB. 

5356 

5357 3) The function is a SIMPLIFIED SOLUTION from the planetary theory 

5358 VSOP2000 (X. Moisson, P. Bretagnon, 2001, Celes. Mechanics & 

5359 Dyn. Astron., 80, 3/4, 205-213) and is an adaptation of original 

5360 Fortran code supplied by P. Bretagnon (private comm., 2000). 

5361 

5362 4) Comparisons over the time span 1900-2100 with this simplified 

5363 solution and the JPL DE405 ephemeris give the following results: 

5364 

5365 RMS max 

5366 Heliocentric: 

5367 position error 3.7 11.2 km 

5368 velocity error 1.4 5.0 mm/s 

5369 

5370 Barycentric: 

5371 position error 4.6 13.4 km 

5372 velocity error 1.4 4.9 mm/s 

5373 

5374 Comparisons with the JPL DE406 ephemeris show that by 1800 and 

5375 2200 the position errors are approximately double their 1900-2100 

5376 size. By 1500 and 2500 the deterioration is a factor of 10 and 

5377 by 1000 and 3000 a factor of 60. The velocity accuracy falls off 

5378 at about half that rate. 

5379 

5380 5) It is permissible to use the same array for pvh and pvb, which 

5381 will receive the barycentric values. 

5382 

5383 This revision: 2021 May 11 

5384 

5385 Copyright (C) 2013-2021, NumFOCUS Foundation. 

5386 Derived, with permission, from the SOFA library. See notes at end of file. 

5387 

5388 """ 

5389 pvh, pvb, c_retval = ufunc.epv00(date1, date2) 

5390 check_errwarn(c_retval, 'epv00') 

5391 return pvh, pvb 

5392 

5393 

5394STATUS_CODES['epv00'] = { 

5395 0: 'OK', 

5396 1: 'warning: date outsidethe range 1900-2100 AD', 

5397} 

5398 

5399 

5400def moon98(date1, date2): 

5401 """ 

5402 Approximate geocentric position and velocity of the Moon. 

5403 

5404 Parameters 

5405 ---------- 

5406 date1 : double array 

5407 date2 : double array 

5408 

5409 Returns 

5410 ------- 

5411 pv : double array 

5412 

5413 Notes 

5414 ----- 

5415 Wraps ERFA function ``eraMoon98``. The ERFA documentation is:: 

5416 

5417 - - - - - - - - - - 

5418 e r a M o o n 9 8 

5419 - - - - - - - - - - 

5420 

5421 Approximate geocentric position and velocity of the Moon. 

5422 

5423 n.b. Not IAU-endorsed and without canonical status. 

5424 

5425 Given: 

5426 date1 double TT date part A (Notes 1,4) 

5427 date2 double TT date part B (Notes 1,4) 

5428 

5429 Returned: 

5430 pv double[2][3] Moon p,v, GCRS (AU, AU/d, Note 5) 

5431 

5432 Notes: 

5433 

5434 1) The TT date date1+date2 is a Julian Date, apportioned in any 

5435 convenient way between the two arguments. For example, 

5436 JD(TT)=2450123.7 could be expressed in any of these ways, among 

5437 others: 

5438 

5439 date1 date2 

5440 

5441 2450123.7 0.0 (JD method) 

5442 2451545.0 -1421.3 (J2000 method) 

5443 2400000.5 50123.2 (MJD method) 

5444 2450123.5 0.2 (date & time method) 

5445 

5446 The JD method is the most natural and convenient to use in cases 

5447 where the loss of several decimal digits of resolution is 

5448 acceptable. The J2000 method is best matched to the way the 

5449 argument is handled internally and will deliver the optimum 

5450 resolution. The MJD method and the date & time methods are both 

5451 good compromises between resolution and convenience. The limited 

5452 accuracy of the present algorithm is such that any of the methods 

5453 is satisfactory. 

5454 

5455 2) This function is a full implementation of the algorithm 

5456 published by Meeus (see reference) except that the light-time 

5457 correction to the Moon's mean longitude has been omitted. 

5458 

5459 3) Comparisons with ELP/MPP02 over the interval 1950-2100 gave RMS 

5460 errors of 2.9 arcsec in geocentric direction, 6.1 km in position 

5461 and 36 mm/s in velocity. The worst case errors were 18.3 arcsec 

5462 in geocentric direction, 31.7 km in position and 172 mm/s in 

5463 velocity. 

5464 

5465 4) The original algorithm is expressed in terms of "dynamical time", 

5466 which can either be TDB or TT without any significant change in 

5467 accuracy. UT cannot be used without incurring significant errors 

5468 (30 arcsec in the present era) due to the Moon's 0.5 arcsec/sec 

5469 movement. 

5470 

5471 5) The result is with respect to the GCRS (the same as J2000.0 mean 

5472 equator and equinox to within 23 mas). 

5473 

5474 6) Velocity is obtained by a complete analytical differentiation 

5475 of the Meeus model. 

5476 

5477 7) The Meeus algorithm generates position and velocity in mean 

5478 ecliptic coordinates of date, which the present function then 

5479 rotates into GCRS. Because the ecliptic system is precessing, 

5480 there is a coupling between this spin (about 1.4 degrees per 

5481 century) and the Moon position that produces a small velocity 

5482 contribution. In the present function this effect is neglected 

5483 as it corresponds to a maximum difference of less than 3 mm/s and 

5484 increases the RMS error by only 0.4%. 

5485 

5486 References: 

5487 

5488 Meeus, J., Astronomical Algorithms, 2nd edition, Willmann-Bell, 

5489 1998, p337. 

5490 

5491 Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

5492 Francou, G. & Laskar, J., Astron.Astrophys., 1994, 282, 663 

5493 

5494 Defined in erfam.h: 

5495 ERFA_DAU astronomical unit (m) 

5496 ERFA_DJC days per Julian century 

5497 ERFA_DJ00 reference epoch (J2000.0), Julian Date 

5498 ERFA_DD2R degrees to radians 

5499 

5500 Called: 

5501 eraS2pv spherical coordinates to pv-vector 

5502 eraPfw06 bias-precession F-W angles, IAU 2006 

5503 eraIr initialize r-matrix to identity 

5504 eraRz rotate around Z-axis 

5505 eraRx rotate around X-axis 

5506 eraRxpv product of r-matrix and pv-vector 

5507 

5508 This revision: 2021 May 11 

5509 

5510 Copyright (C) 2013-2021, NumFOCUS Foundation. 

5511 Derived, with permission, from the SOFA library. See notes at end of file. 

5512 

5513 """ 

5514 pv = ufunc.moon98(date1, date2) 

5515 return pv 

5516 

5517 

5518def plan94(date1, date2, np): 

5519 """ 

5520 Approximate heliocentric position and velocity of a nominated major 

5521 planet: Mercury, Venus, EMB, Mars, Jupiter, Saturn, Uranus or 

5522 Neptune (but not the Earth itself). 

5523 

5524 Parameters 

5525 ---------- 

5526 date1 : double array 

5527 date2 : double array 

5528 np : int array 

5529 

5530 Returns 

5531 ------- 

5532 pv : double array 

5533 

5534 Notes 

5535 ----- 

5536 Wraps ERFA function ``eraPlan94``. The ERFA documentation is:: 

5537 

5538 - - - - - - - - - - 

5539 e r a P l a n 9 4 

5540 - - - - - - - - - - 

5541 

5542 Approximate heliocentric position and velocity of a nominated major 

5543 planet: Mercury, Venus, EMB, Mars, Jupiter, Saturn, Uranus or 

5544 Neptune (but not the Earth itself). 

5545 

5546 n.b. Not IAU-endorsed and without canonical status. 

5547 

5548 Given: 

5549 date1 double TDB date part A (Note 1) 

5550 date2 double TDB date part B (Note 1) 

5551 np int planet (1=Mercury, 2=Venus, 3=EMB, 4=Mars, 

5552 5=Jupiter, 6=Saturn, 7=Uranus, 8=Neptune) 

5553 

5554 Returned (argument): 

5555 pv double[2][3] planet p,v (heliocentric, J2000.0, au,au/d) 

5556 

5557 Returned (function value): 

5558 int status: -1 = illegal NP (outside 1-8) 

5559 0 = OK 

5560 +1 = warning: year outside 1000-3000 

5561 +2 = warning: failed to converge 

5562 

5563 Notes: 

5564 

5565 1) The date date1+date2 is in the TDB time scale (in practice TT can 

5566 be used) and is a Julian Date, apportioned in any convenient way 

5567 between the two arguments. For example, JD(TDB)=2450123.7 could 

5568 be expressed in any of these ways, among others: 

5569 

5570 date1 date2 

5571 

5572 2450123.7 0.0 (JD method) 

5573 2451545.0 -1421.3 (J2000 method) 

5574 2400000.5 50123.2 (MJD method) 

5575 2450123.5 0.2 (date & time method) 

5576 

5577 The JD method is the most natural and convenient to use in cases 

5578 where the loss of several decimal digits of resolution is 

5579 acceptable. The J2000 method is best matched to the way the 

5580 argument is handled internally and will deliver the optimum 

5581 resolution. The MJD method and the date & time methods are both 

5582 good compromises between resolution and convenience. The limited 

5583 accuracy of the present algorithm is such that any of the methods 

5584 is satisfactory. 

5585 

5586 2) If an np value outside the range 1-8 is supplied, an error status 

5587 (function value -1) is returned and the pv vector set to zeroes. 

5588 

5589 3) For np=3 the result is for the Earth-Moon Barycenter. To obtain 

5590 the heliocentric position and velocity of the Earth, use instead 

5591 the ERFA function eraEpv00. 

5592 

5593 4) On successful return, the array pv contains the following: 

5594 

5595 pv[0][0] x } 

5596 pv[0][1] y } heliocentric position, au 

5597 pv[0][2] z } 

5598 

5599 pv[1][0] xdot } 

5600 pv[1][1] ydot } heliocentric velocity, au/d 

5601 pv[1][2] zdot } 

5602 

5603 The reference frame is equatorial and is with respect to the 

5604 mean equator and equinox of epoch J2000.0. 

5605 

5606 5) The algorithm is due to J.L. Simon, P. Bretagnon, J. Chapront, 

5607 M. Chapront-Touze, G. Francou and J. Laskar (Bureau des 

5608 Longitudes, Paris, France). From comparisons with JPL 

5609 ephemeris DE102, they quote the following maximum errors 

5610 over the interval 1800-2050: 

5611 

5612 L (arcsec) B (arcsec) R (km) 

5613 

5614 Mercury 4 1 300 

5615 Venus 5 1 800 

5616 EMB 6 1 1000 

5617 Mars 17 1 7700 

5618 Jupiter 71 5 76000 

5619 Saturn 81 13 267000 

5620 Uranus 86 7 712000 

5621 Neptune 11 1 253000 

5622 

5623 Over the interval 1000-3000, they report that the accuracy is no 

5624 worse than 1.5 times that over 1800-2050. Outside 1000-3000 the 

5625 accuracy declines. 

5626 

5627 Comparisons of the present function with the JPL DE200 ephemeris 

5628 give the following RMS errors over the interval 1960-2025: 

5629 

5630 position (km) velocity (m/s) 

5631 

5632 Mercury 334 0.437 

5633 Venus 1060 0.855 

5634 EMB 2010 0.815 

5635 Mars 7690 1.98 

5636 Jupiter 71700 7.70 

5637 Saturn 199000 19.4 

5638 Uranus 564000 16.4 

5639 Neptune 158000 14.4 

5640 

5641 Comparisons against DE200 over the interval 1800-2100 gave the 

5642 following maximum absolute differences. (The results using 

5643 DE406 were essentially the same.) 

5644 

5645 L (arcsec) B (arcsec) R (km) Rdot (m/s) 

5646 

5647 Mercury 7 1 500 0.7 

5648 Venus 7 1 1100 0.9 

5649 EMB 9 1 1300 1.0 

5650 Mars 26 1 9000 2.5 

5651 Jupiter 78 6 82000 8.2 

5652 Saturn 87 14 263000 24.6 

5653 Uranus 86 7 661000 27.4 

5654 Neptune 11 2 248000 21.4 

5655 

5656 6) The present ERFA re-implementation of the original Simon et al. 

5657 Fortran code differs from the original in the following respects: 

5658 

5659 C instead of Fortran. 

5660 

5661 The date is supplied in two parts. 

5662 

5663 The result is returned only in equatorial Cartesian form; 

5664 the ecliptic longitude, latitude and radius vector are not 

5665 returned. 

5666 

5667 The result is in the J2000.0 equatorial frame, not ecliptic. 

5668 

5669 More is done in-line: there are fewer calls to subroutines. 

5670 

5671 Different error/warning status values are used. 

5672 

5673 A different Kepler's-equation-solver is used (avoiding 

5674 use of double precision complex). 

5675 

5676 Polynomials in t are nested to minimize rounding errors. 

5677 

5678 Explicit double constants are used to avoid mixed-mode 

5679 expressions. 

5680 

5681 None of the above changes affects the result significantly. 

5682 

5683 7) The returned status indicates the most serious condition 

5684 encountered during execution of the function. Illegal np is 

5685 considered the most serious, overriding failure to converge, 

5686 which in turn takes precedence over the remote date warning. 

5687 

5688 Called: 

5689 eraAnpm normalize angle into range +/- pi 

5690 

5691 Reference: Simon, J.L, Bretagnon, P., Chapront, J., 

5692 Chapront-Touze, M., Francou, G., and Laskar, J., 

5693 Astron.Astrophys., 282, 663 (1994). 

5694 

5695 This revision: 2021 May 11 

5696 

5697 Copyright (C) 2013-2021, NumFOCUS Foundation. 

5698 Derived, with permission, from the SOFA library. See notes at end of file. 

5699 

5700 """ 

5701 pv, c_retval = ufunc.plan94(date1, date2, np) 

5702 check_errwarn(c_retval, 'plan94') 

5703 return pv 

5704 

5705 

5706STATUS_CODES['plan94'] = { 

5707 -1: 'illegal NP (outside 1-8)', 

5708 0: 'OK', 

5709 1: 'warning: year outside 1000-3000', 

5710 2: 'warning: failed to converge', 

5711} 

5712 

5713 

5714def fad03(t): 

5715 """ 

5716 Fundamental argument, IERS Conventions (2003): 

5717 mean elongation of the Moon from the Sun. 

5718 

5719 Parameters 

5720 ---------- 

5721 t : double array 

5722 

5723 Returns 

5724 ------- 

5725 c_retval : double array 

5726 

5727 Notes 

5728 ----- 

5729 Wraps ERFA function ``eraFad03``. The ERFA documentation is:: 

5730 

5731 - - - - - - - - - 

5732 e r a F a d 0 3 

5733 - - - - - - - - - 

5734 

5735 Fundamental argument, IERS Conventions (2003): 

5736 mean elongation of the Moon from the Sun. 

5737 

5738 Given: 

5739 t double TDB, Julian centuries since J2000.0 (Note 1) 

5740 

5741 Returned (function value): 

5742 double D, radians (Note 2) 

5743 

5744 Notes: 

5745 

5746 1) Though t is strictly TDB, it is usually more convenient to use 

5747 TT, which makes no significant difference. 

5748 

5749 2) The expression used is as adopted in IERS Conventions (2003) and 

5750 is from Simon et al. (1994). 

5751 

5752 References: 

5753 

5754 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

5755 IERS Technical Note No. 32, BKG (2004) 

5756 

5757 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

5758 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

5759 

5760 This revision: 2021 May 11 

5761 

5762 Copyright (C) 2013-2021, NumFOCUS Foundation. 

5763 Derived, with permission, from the SOFA library. See notes at end of file. 

5764 

5765 """ 

5766 c_retval = ufunc.fad03(t) 

5767 return c_retval 

5768 

5769 

5770def fae03(t): 

5771 """ 

5772 Fundamental argument, IERS Conventions (2003): 

5773 mean longitude of Earth. 

5774 

5775 Parameters 

5776 ---------- 

5777 t : double array 

5778 

5779 Returns 

5780 ------- 

5781 c_retval : double array 

5782 

5783 Notes 

5784 ----- 

5785 Wraps ERFA function ``eraFae03``. The ERFA documentation is:: 

5786 

5787 - - - - - - - - - 

5788 e r a F a e 0 3 

5789 - - - - - - - - - 

5790 

5791 Fundamental argument, IERS Conventions (2003): 

5792 mean longitude of Earth. 

5793 

5794 Given: 

5795 t double TDB, Julian centuries since J2000.0 (Note 1) 

5796 

5797 Returned (function value): 

5798 double mean longitude of Earth, radians (Note 2) 

5799 

5800 Notes: 

5801 

5802 1) Though t is strictly TDB, it is usually more convenient to use 

5803 TT, which makes no significant difference. 

5804 

5805 2) The expression used is as adopted in IERS Conventions (2003) and 

5806 comes from Souchay et al. (1999) after Simon et al. (1994). 

5807 

5808 References: 

5809 

5810 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

5811 IERS Technical Note No. 32, BKG (2004) 

5812 

5813 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

5814 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

5815 

5816 Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, 

5817 Astron.Astrophys.Supp.Ser. 135, 111 

5818 

5819 This revision: 2021 May 11 

5820 

5821 Copyright (C) 2013-2021, NumFOCUS Foundation. 

5822 Derived, with permission, from the SOFA library. See notes at end of file. 

5823 

5824 """ 

5825 c_retval = ufunc.fae03(t) 

5826 return c_retval 

5827 

5828 

5829def faf03(t): 

5830 """ 

5831 Fundamental argument, IERS Conventions (2003): 

5832 mean longitude of the Moon minus mean longitude of the ascending 

5833 node. 

5834 

5835 Parameters 

5836 ---------- 

5837 t : double array 

5838 

5839 Returns 

5840 ------- 

5841 c_retval : double array 

5842 

5843 Notes 

5844 ----- 

5845 Wraps ERFA function ``eraFaf03``. The ERFA documentation is:: 

5846 

5847 - - - - - - - - - 

5848 e r a F a f 0 3 

5849 - - - - - - - - - 

5850 

5851 Fundamental argument, IERS Conventions (2003): 

5852 mean longitude of the Moon minus mean longitude of the ascending 

5853 node. 

5854 

5855 Given: 

5856 t double TDB, Julian centuries since J2000.0 (Note 1) 

5857 

5858 Returned (function value): 

5859 double F, radians (Note 2) 

5860 

5861 Notes: 

5862 

5863 1) Though t is strictly TDB, it is usually more convenient to use 

5864 TT, which makes no significant difference. 

5865 

5866 2) The expression used is as adopted in IERS Conventions (2003) and 

5867 is from Simon et al. (1994). 

5868 

5869 References: 

5870 

5871 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

5872 IERS Technical Note No. 32, BKG (2004) 

5873 

5874 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

5875 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

5876 

5877 This revision: 2021 May 11 

5878 

5879 Copyright (C) 2013-2021, NumFOCUS Foundation. 

5880 Derived, with permission, from the SOFA library. See notes at end of file. 

5881 

5882 """ 

5883 c_retval = ufunc.faf03(t) 

5884 return c_retval 

5885 

5886 

5887def faju03(t): 

5888 """ 

5889 Fundamental argument, IERS Conventions (2003): 

5890 mean longitude of Jupiter. 

5891 

5892 Parameters 

5893 ---------- 

5894 t : double array 

5895 

5896 Returns 

5897 ------- 

5898 c_retval : double array 

5899 

5900 Notes 

5901 ----- 

5902 Wraps ERFA function ``eraFaju03``. The ERFA documentation is:: 

5903 

5904 - - - - - - - - - - 

5905 e r a F a j u 0 3 

5906 - - - - - - - - - - 

5907 

5908 Fundamental argument, IERS Conventions (2003): 

5909 mean longitude of Jupiter. 

5910 

5911 Given: 

5912 t double TDB, Julian centuries since J2000.0 (Note 1) 

5913 

5914 Returned (function value): 

5915 double mean longitude of Jupiter, radians (Note 2) 

5916 

5917 Notes: 

5918 

5919 1) Though t is strictly TDB, it is usually more convenient to use 

5920 TT, which makes no significant difference. 

5921 

5922 2) The expression used is as adopted in IERS Conventions (2003) and 

5923 comes from Souchay et al. (1999) after Simon et al. (1994). 

5924 

5925 References: 

5926 

5927 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

5928 IERS Technical Note No. 32, BKG (2004) 

5929 

5930 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

5931 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

5932 

5933 Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, 

5934 Astron.Astrophys.Supp.Ser. 135, 111 

5935 

5936 This revision: 2021 May 11 

5937 

5938 Copyright (C) 2013-2021, NumFOCUS Foundation. 

5939 Derived, with permission, from the SOFA library. See notes at end of file. 

5940 

5941 """ 

5942 c_retval = ufunc.faju03(t) 

5943 return c_retval 

5944 

5945 

5946def fal03(t): 

5947 """ 

5948 Fundamental argument, IERS Conventions (2003): 

5949 mean anomaly of the Moon. 

5950 

5951 Parameters 

5952 ---------- 

5953 t : double array 

5954 

5955 Returns 

5956 ------- 

5957 c_retval : double array 

5958 

5959 Notes 

5960 ----- 

5961 Wraps ERFA function ``eraFal03``. The ERFA documentation is:: 

5962 

5963 - - - - - - - - - 

5964 e r a F a l 0 3 

5965 - - - - - - - - - 

5966 

5967 Fundamental argument, IERS Conventions (2003): 

5968 mean anomaly of the Moon. 

5969 

5970 Given: 

5971 t double TDB, Julian centuries since J2000.0 (Note 1) 

5972 

5973 Returned (function value): 

5974 double l, radians (Note 2) 

5975 

5976 Notes: 

5977 

5978 1) Though t is strictly TDB, it is usually more convenient to use 

5979 TT, which makes no significant difference. 

5980 

5981 2) The expression used is as adopted in IERS Conventions (2003) and 

5982 is from Simon et al. (1994). 

5983 

5984 References: 

5985 

5986 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

5987 IERS Technical Note No. 32, BKG (2004) 

5988 

5989 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

5990 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

5991 

5992 This revision: 2021 May 11 

5993 

5994 Copyright (C) 2013-2021, NumFOCUS Foundation. 

5995 Derived, with permission, from the SOFA library. See notes at end of file. 

5996 

5997 """ 

5998 c_retval = ufunc.fal03(t) 

5999 return c_retval 

6000 

6001 

6002def falp03(t): 

6003 """ 

6004 Fundamental argument, IERS Conventions (2003): 

6005 mean anomaly of the Sun. 

6006 

6007 Parameters 

6008 ---------- 

6009 t : double array 

6010 

6011 Returns 

6012 ------- 

6013 c_retval : double array 

6014 

6015 Notes 

6016 ----- 

6017 Wraps ERFA function ``eraFalp03``. The ERFA documentation is:: 

6018 

6019 - - - - - - - - - - 

6020 e r a F a l p 0 3 

6021 - - - - - - - - - - 

6022 

6023 Fundamental argument, IERS Conventions (2003): 

6024 mean anomaly of the Sun. 

6025 

6026 Given: 

6027 t double TDB, Julian centuries since J2000.0 (Note 1) 

6028 

6029 Returned (function value): 

6030 double l', radians (Note 2) 

6031 

6032 Notes: 

6033 

6034 1) Though t is strictly TDB, it is usually more convenient to use 

6035 TT, which makes no significant difference. 

6036 

6037 2) The expression used is as adopted in IERS Conventions (2003) and 

6038 is from Simon et al. (1994). 

6039 

6040 References: 

6041 

6042 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

6043 IERS Technical Note No. 32, BKG (2004) 

6044 

6045 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

6046 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

6047 

6048 This revision: 2021 May 11 

6049 

6050 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6051 Derived, with permission, from the SOFA library. See notes at end of file. 

6052 

6053 """ 

6054 c_retval = ufunc.falp03(t) 

6055 return c_retval 

6056 

6057 

6058def fama03(t): 

6059 """ 

6060 Fundamental argument, IERS Conventions (2003): 

6061 mean longitude of Mars. 

6062 

6063 Parameters 

6064 ---------- 

6065 t : double array 

6066 

6067 Returns 

6068 ------- 

6069 c_retval : double array 

6070 

6071 Notes 

6072 ----- 

6073 Wraps ERFA function ``eraFama03``. The ERFA documentation is:: 

6074 

6075 - - - - - - - - - - 

6076 e r a F a m a 0 3 

6077 - - - - - - - - - - 

6078 

6079 Fundamental argument, IERS Conventions (2003): 

6080 mean longitude of Mars. 

6081 

6082 Given: 

6083 t double TDB, Julian centuries since J2000.0 (Note 1) 

6084 

6085 Returned (function value): 

6086 double mean longitude of Mars, radians (Note 2) 

6087 

6088 Notes: 

6089 

6090 1) Though t is strictly TDB, it is usually more convenient to use 

6091 TT, which makes no significant difference. 

6092 

6093 2) The expression used is as adopted in IERS Conventions (2003) and 

6094 comes from Souchay et al. (1999) after Simon et al. (1994). 

6095 

6096 References: 

6097 

6098 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

6099 IERS Technical Note No. 32, BKG (2004) 

6100 

6101 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

6102 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

6103 

6104 Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, 

6105 Astron.Astrophys.Supp.Ser. 135, 111 

6106 

6107 This revision: 2021 May 11 

6108 

6109 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6110 Derived, with permission, from the SOFA library. See notes at end of file. 

6111 

6112 """ 

6113 c_retval = ufunc.fama03(t) 

6114 return c_retval 

6115 

6116 

6117def fame03(t): 

6118 """ 

6119 Fundamental argument, IERS Conventions (2003): 

6120 mean longitude of Mercury. 

6121 

6122 Parameters 

6123 ---------- 

6124 t : double array 

6125 

6126 Returns 

6127 ------- 

6128 c_retval : double array 

6129 

6130 Notes 

6131 ----- 

6132 Wraps ERFA function ``eraFame03``. The ERFA documentation is:: 

6133 

6134 - - - - - - - - - - 

6135 e r a F a m e 0 3 

6136 - - - - - - - - - - 

6137 

6138 Fundamental argument, IERS Conventions (2003): 

6139 mean longitude of Mercury. 

6140 

6141 Given: 

6142 t double TDB, Julian centuries since J2000.0 (Note 1) 

6143 

6144 Returned (function value): 

6145 double mean longitude of Mercury, radians (Note 2) 

6146 

6147 Notes: 

6148 

6149 1) Though t is strictly TDB, it is usually more convenient to use 

6150 TT, which makes no significant difference. 

6151 

6152 2) The expression used is as adopted in IERS Conventions (2003) and 

6153 comes from Souchay et al. (1999) after Simon et al. (1994). 

6154 

6155 References: 

6156 

6157 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

6158 IERS Technical Note No. 32, BKG (2004) 

6159 

6160 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

6161 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

6162 

6163 Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, 

6164 Astron.Astrophys.Supp.Ser. 135, 111 

6165 

6166 This revision: 2021 May 11 

6167 

6168 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6169 Derived, with permission, from the SOFA library. See notes at end of file. 

6170 

6171 """ 

6172 c_retval = ufunc.fame03(t) 

6173 return c_retval 

6174 

6175 

6176def fane03(t): 

6177 """ 

6178 Fundamental argument, IERS Conventions (2003): 

6179 mean longitude of Neptune. 

6180 

6181 Parameters 

6182 ---------- 

6183 t : double array 

6184 

6185 Returns 

6186 ------- 

6187 c_retval : double array 

6188 

6189 Notes 

6190 ----- 

6191 Wraps ERFA function ``eraFane03``. The ERFA documentation is:: 

6192 

6193 - - - - - - - - - - 

6194 e r a F a n e 0 3 

6195 - - - - - - - - - - 

6196 

6197 Fundamental argument, IERS Conventions (2003): 

6198 mean longitude of Neptune. 

6199 

6200 Given: 

6201 t double TDB, Julian centuries since J2000.0 (Note 1) 

6202 

6203 Returned (function value): 

6204 double mean longitude of Neptune, radians (Note 2) 

6205 

6206 Notes: 

6207 

6208 1) Though t is strictly TDB, it is usually more convenient to use 

6209 TT, which makes no significant difference. 

6210 

6211 2) The expression used is as adopted in IERS Conventions (2003) and 

6212 is adapted from Simon et al. (1994). 

6213 

6214 References: 

6215 

6216 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

6217 IERS Technical Note No. 32, BKG (2004) 

6218 

6219 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

6220 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

6221 

6222 This revision: 2021 May 11 

6223 

6224 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6225 Derived, with permission, from the SOFA library. See notes at end of file. 

6226 

6227 """ 

6228 c_retval = ufunc.fane03(t) 

6229 return c_retval 

6230 

6231 

6232def faom03(t): 

6233 """ 

6234 Fundamental argument, IERS Conventions (2003): 

6235 mean longitude of the Moon's ascending node. 

6236 

6237 Parameters 

6238 ---------- 

6239 t : double array 

6240 

6241 Returns 

6242 ------- 

6243 c_retval : double array 

6244 

6245 Notes 

6246 ----- 

6247 Wraps ERFA function ``eraFaom03``. The ERFA documentation is:: 

6248 

6249 - - - - - - - - - - 

6250 e r a F a o m 0 3 

6251 - - - - - - - - - - 

6252 

6253 Fundamental argument, IERS Conventions (2003): 

6254 mean longitude of the Moon's ascending node. 

6255 

6256 Given: 

6257 t double TDB, Julian centuries since J2000.0 (Note 1) 

6258 

6259 Returned (function value): 

6260 double Omega, radians (Note 2) 

6261 

6262 Notes: 

6263 

6264 1) Though t is strictly TDB, it is usually more convenient to use 

6265 TT, which makes no significant difference. 

6266 

6267 2) The expression used is as adopted in IERS Conventions (2003) and 

6268 is from Simon et al. (1994). 

6269 

6270 References: 

6271 

6272 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

6273 IERS Technical Note No. 32, BKG (2004) 

6274 

6275 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

6276 Francou, G., Laskar, J., 1994, Astron.Astrophys. 282, 663-683. 

6277 

6278 This revision: 2021 May 11 

6279 

6280 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6281 Derived, with permission, from the SOFA library. See notes at end of file. 

6282 

6283 """ 

6284 c_retval = ufunc.faom03(t) 

6285 return c_retval 

6286 

6287 

6288def fapa03(t): 

6289 """ 

6290 Fundamental argument, IERS Conventions (2003): 

6291 general accumulated precession in longitude. 

6292 

6293 Parameters 

6294 ---------- 

6295 t : double array 

6296 

6297 Returns 

6298 ------- 

6299 c_retval : double array 

6300 

6301 Notes 

6302 ----- 

6303 Wraps ERFA function ``eraFapa03``. The ERFA documentation is:: 

6304 

6305 - - - - - - - - - - 

6306 e r a F a p a 0 3 

6307 - - - - - - - - - - 

6308 

6309 Fundamental argument, IERS Conventions (2003): 

6310 general accumulated precession in longitude. 

6311 

6312 Given: 

6313 t double TDB, Julian centuries since J2000.0 (Note 1) 

6314 

6315 Returned (function value): 

6316 double general precession in longitude, radians (Note 2) 

6317 

6318 Notes: 

6319 

6320 1) Though t is strictly TDB, it is usually more convenient to use 

6321 TT, which makes no significant difference. 

6322 

6323 2) The expression used is as adopted in IERS Conventions (2003). It 

6324 is taken from Kinoshita & Souchay (1990) and comes originally 

6325 from Lieske et al. (1977). 

6326 

6327 References: 

6328 

6329 Kinoshita, H. and Souchay J. 1990, Celest.Mech. and Dyn.Astron. 

6330 48, 187 

6331 

6332 Lieske, J.H., Lederle, T., Fricke, W. & Morando, B. 1977, 

6333 Astron.Astrophys. 58, 1-16 

6334 

6335 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

6336 IERS Technical Note No. 32, BKG (2004) 

6337 

6338 This revision: 2021 May 11 

6339 

6340 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6341 Derived, with permission, from the SOFA library. See notes at end of file. 

6342 

6343 """ 

6344 c_retval = ufunc.fapa03(t) 

6345 return c_retval 

6346 

6347 

6348def fasa03(t): 

6349 """ 

6350 Fundamental argument, IERS Conventions (2003): 

6351 mean longitude of Saturn. 

6352 

6353 Parameters 

6354 ---------- 

6355 t : double array 

6356 

6357 Returns 

6358 ------- 

6359 c_retval : double array 

6360 

6361 Notes 

6362 ----- 

6363 Wraps ERFA function ``eraFasa03``. The ERFA documentation is:: 

6364 

6365 - - - - - - - - - - 

6366 e r a F a s a 0 3 

6367 - - - - - - - - - - 

6368 

6369 Fundamental argument, IERS Conventions (2003): 

6370 mean longitude of Saturn. 

6371 

6372 Given: 

6373 t double TDB, Julian centuries since J2000.0 (Note 1) 

6374 

6375 Returned (function value): 

6376 double mean longitude of Saturn, radians (Note 2) 

6377 

6378 Notes: 

6379 

6380 1) Though t is strictly TDB, it is usually more convenient to use 

6381 TT, which makes no significant difference. 

6382 

6383 2) The expression used is as adopted in IERS Conventions (2003) and 

6384 comes from Souchay et al. (1999) after Simon et al. (1994). 

6385 

6386 References: 

6387 

6388 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

6389 IERS Technical Note No. 32, BKG (2004) 

6390 

6391 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

6392 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

6393 

6394 Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, 

6395 Astron.Astrophys.Supp.Ser. 135, 111 

6396 

6397 This revision: 2021 May 11 

6398 

6399 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6400 Derived, with permission, from the SOFA library. See notes at end of file. 

6401 

6402 """ 

6403 c_retval = ufunc.fasa03(t) 

6404 return c_retval 

6405 

6406 

6407def faur03(t): 

6408 """ 

6409 Fundamental argument, IERS Conventions (2003): 

6410 mean longitude of Uranus. 

6411 

6412 Parameters 

6413 ---------- 

6414 t : double array 

6415 

6416 Returns 

6417 ------- 

6418 c_retval : double array 

6419 

6420 Notes 

6421 ----- 

6422 Wraps ERFA function ``eraFaur03``. The ERFA documentation is:: 

6423 

6424 - - - - - - - - - - 

6425 e r a F a u r 0 3 

6426 - - - - - - - - - - 

6427 

6428 Fundamental argument, IERS Conventions (2003): 

6429 mean longitude of Uranus. 

6430 

6431 Given: 

6432 t double TDB, Julian centuries since J2000.0 (Note 1) 

6433 

6434 Returned (function value): 

6435 double mean longitude of Uranus, radians (Note 2) 

6436 

6437 Notes: 

6438 

6439 1) Though t is strictly TDB, it is usually more convenient to use 

6440 TT, which makes no significant difference. 

6441 

6442 2) The expression used is as adopted in IERS Conventions (2003) and 

6443 is adapted from Simon et al. (1994). 

6444 

6445 References: 

6446 

6447 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

6448 IERS Technical Note No. 32, BKG (2004) 

6449 

6450 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

6451 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

6452 

6453 This revision: 2021 May 11 

6454 

6455 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6456 Derived, with permission, from the SOFA library. See notes at end of file. 

6457 

6458 """ 

6459 c_retval = ufunc.faur03(t) 

6460 return c_retval 

6461 

6462 

6463def fave03(t): 

6464 """ 

6465 Fundamental argument, IERS Conventions (2003): 

6466 mean longitude of Venus. 

6467 

6468 Parameters 

6469 ---------- 

6470 t : double array 

6471 

6472 Returns 

6473 ------- 

6474 c_retval : double array 

6475 

6476 Notes 

6477 ----- 

6478 Wraps ERFA function ``eraFave03``. The ERFA documentation is:: 

6479 

6480 - - - - - - - - - - 

6481 e r a F a v e 0 3 

6482 - - - - - - - - - - 

6483 

6484 Fundamental argument, IERS Conventions (2003): 

6485 mean longitude of Venus. 

6486 

6487 Given: 

6488 t double TDB, Julian centuries since J2000.0 (Note 1) 

6489 

6490 Returned (function value): 

6491 double mean longitude of Venus, radians (Note 2) 

6492 

6493 Notes: 

6494 

6495 1) Though t is strictly TDB, it is usually more convenient to use 

6496 TT, which makes no significant difference. 

6497 

6498 2) The expression used is as adopted in IERS Conventions (2003) and 

6499 comes from Souchay et al. (1999) after Simon et al. (1994). 

6500 

6501 References: 

6502 

6503 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

6504 IERS Technical Note No. 32, BKG (2004) 

6505 

6506 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

6507 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

6508 

6509 Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, 

6510 Astron.Astrophys.Supp.Ser. 135, 111 

6511 

6512 This revision: 2021 May 11 

6513 

6514 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6515 Derived, with permission, from the SOFA library. See notes at end of file. 

6516 

6517 """ 

6518 c_retval = ufunc.fave03(t) 

6519 return c_retval 

6520 

6521 

6522def bi00(): 

6523 """ 

6524 Frame bias components of IAU 2000 precession-nutation models; part 

6525 of the Mathews-Herring-Buffett (MHB2000) nutation series, with 

6526 additions. 

6527 

6528 Returns 

6529 ------- 

6530 dpsibi : double array 

6531 depsbi : double array 

6532 dra : double array 

6533 

6534 Notes 

6535 ----- 

6536 Wraps ERFA function ``eraBi00``. The ERFA documentation is:: 

6537 

6538 - - - - - - - - 

6539 e r a B i 0 0 

6540 - - - - - - - - 

6541 

6542 Frame bias components of IAU 2000 precession-nutation models; part 

6543 of the Mathews-Herring-Buffett (MHB2000) nutation series, with 

6544 additions. 

6545 

6546 Returned: 

6547 dpsibi,depsbi double longitude and obliquity corrections 

6548 dra double the ICRS RA of the J2000.0 mean equinox 

6549 

6550 Notes: 

6551 

6552 1) The frame bias corrections in longitude and obliquity (radians) 

6553 are required in order to correct for the offset between the GCRS 

6554 pole and the mean J2000.0 pole. They define, with respect to the 

6555 GCRS frame, a J2000.0 mean pole that is consistent with the rest 

6556 of the IAU 2000A precession-nutation model. 

6557 

6558 2) In addition to the displacement of the pole, the complete 

6559 description of the frame bias requires also an offset in right 

6560 ascension. This is not part of the IAU 2000A model, and is from 

6561 Chapront et al. (2002). It is returned in radians. 

6562 

6563 3) This is a supplemented implementation of one aspect of the IAU 

6564 2000A nutation model, formally adopted by the IAU General 

6565 Assembly in 2000, namely MHB2000 (Mathews et al. 2002). 

6566 

6567 References: 

6568 

6569 Chapront, J., Chapront-Touze, M. & Francou, G., Astron. 

6570 Astrophys., 387, 700, 2002. 

6571 

6572 Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation 

6573 and precession: New nutation series for nonrigid Earth and 

6574 insights into the Earth's interior", J.Geophys.Res., 107, B4, 

6575 2002. The MHB2000 code itself was obtained on 2002 September 9 

6576 from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A. 

6577 

6578 This revision: 2021 May 11 

6579 

6580 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6581 Derived, with permission, from the SOFA library. See notes at end of file. 

6582 

6583 """ 

6584 dpsibi, depsbi, dra = ufunc.bi00() 

6585 return dpsibi, depsbi, dra 

6586 

6587 

6588def bp00(date1, date2): 

6589 """ 

6590 Frame bias and precession, IAU 2000. 

6591 

6592 Parameters 

6593 ---------- 

6594 date1 : double array 

6595 date2 : double array 

6596 

6597 Returns 

6598 ------- 

6599 rb : double array 

6600 rp : double array 

6601 rbp : double array 

6602 

6603 Notes 

6604 ----- 

6605 Wraps ERFA function ``eraBp00``. The ERFA documentation is:: 

6606 

6607 - - - - - - - - 

6608 e r a B p 0 0 

6609 - - - - - - - - 

6610 

6611 Frame bias and precession, IAU 2000. 

6612 

6613 Given: 

6614 date1,date2 double TT as a 2-part Julian Date (Note 1) 

6615 

6616 Returned: 

6617 rb double[3][3] frame bias matrix (Note 2) 

6618 rp double[3][3] precession matrix (Note 3) 

6619 rbp double[3][3] bias-precession matrix (Note 4) 

6620 

6621 Notes: 

6622 

6623 1) The TT date date1+date2 is a Julian Date, apportioned in any 

6624 convenient way between the two arguments. For example, 

6625 JD(TT)=2450123.7 could be expressed in any of these ways, 

6626 among others: 

6627 

6628 date1 date2 

6629 

6630 2450123.7 0.0 (JD method) 

6631 2451545.0 -1421.3 (J2000 method) 

6632 2400000.5 50123.2 (MJD method) 

6633 2450123.5 0.2 (date & time method) 

6634 

6635 The JD method is the most natural and convenient to use in 

6636 cases where the loss of several decimal digits of resolution 

6637 is acceptable. The J2000 method is best matched to the way 

6638 the argument is handled internally and will deliver the 

6639 optimum resolution. The MJD method and the date & time methods 

6640 are both good compromises between resolution and convenience. 

6641 

6642 2) The matrix rb transforms vectors from GCRS to mean J2000.0 by 

6643 applying frame bias. 

6644 

6645 3) The matrix rp transforms vectors from J2000.0 mean equator and 

6646 equinox to mean equator and equinox of date by applying 

6647 precession. 

6648 

6649 4) The matrix rbp transforms vectors from GCRS to mean equator and 

6650 equinox of date by applying frame bias then precession. It is 

6651 the product rp x rb. 

6652 

6653 5) It is permissible to re-use the same array in the returned 

6654 arguments. The arrays are filled in the order given. 

6655 

6656 Called: 

6657 eraBi00 frame bias components, IAU 2000 

6658 eraPr00 IAU 2000 precession adjustments 

6659 eraIr initialize r-matrix to identity 

6660 eraRx rotate around X-axis 

6661 eraRy rotate around Y-axis 

6662 eraRz rotate around Z-axis 

6663 eraCr copy r-matrix 

6664 eraRxr product of two r-matrices 

6665 

6666 Reference: 

6667 "Expressions for the Celestial Intermediate Pole and Celestial 

6668 Ephemeris Origin consistent with the IAU 2000A precession- 

6669 nutation model", Astron.Astrophys. 400, 1145-1154 (2003) 

6670 

6671 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

6672 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

6673 

6674 This revision: 2021 May 11 

6675 

6676 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6677 Derived, with permission, from the SOFA library. See notes at end of file. 

6678 

6679 """ 

6680 rb, rp, rbp = ufunc.bp00(date1, date2) 

6681 return rb, rp, rbp 

6682 

6683 

6684def bp06(date1, date2): 

6685 """ 

6686 Frame bias and precession, IAU 2006. 

6687 

6688 Parameters 

6689 ---------- 

6690 date1 : double array 

6691 date2 : double array 

6692 

6693 Returns 

6694 ------- 

6695 rb : double array 

6696 rp : double array 

6697 rbp : double array 

6698 

6699 Notes 

6700 ----- 

6701 Wraps ERFA function ``eraBp06``. The ERFA documentation is:: 

6702 

6703 - - - - - - - - 

6704 e r a B p 0 6 

6705 - - - - - - - - 

6706 

6707 Frame bias and precession, IAU 2006. 

6708 

6709 Given: 

6710 date1,date2 double TT as a 2-part Julian Date (Note 1) 

6711 

6712 Returned: 

6713 rb double[3][3] frame bias matrix (Note 2) 

6714 rp double[3][3] precession matrix (Note 3) 

6715 rbp double[3][3] bias-precession matrix (Note 4) 

6716 

6717 Notes: 

6718 

6719 1) The TT date date1+date2 is a Julian Date, apportioned in any 

6720 convenient way between the two arguments. For example, 

6721 JD(TT)=2450123.7 could be expressed in any of these ways, 

6722 among others: 

6723 

6724 date1 date2 

6725 

6726 2450123.7 0.0 (JD method) 

6727 2451545.0 -1421.3 (J2000 method) 

6728 2400000.5 50123.2 (MJD method) 

6729 2450123.5 0.2 (date & time method) 

6730 

6731 The JD method is the most natural and convenient to use in 

6732 cases where the loss of several decimal digits of resolution 

6733 is acceptable. The J2000 method is best matched to the way 

6734 the argument is handled internally and will deliver the 

6735 optimum resolution. The MJD method and the date & time methods 

6736 are both good compromises between resolution and convenience. 

6737 

6738 2) The matrix rb transforms vectors from GCRS to mean J2000.0 by 

6739 applying frame bias. 

6740 

6741 3) The matrix rp transforms vectors from mean J2000.0 to mean of 

6742 date by applying precession. 

6743 

6744 4) The matrix rbp transforms vectors from GCRS to mean of date by 

6745 applying frame bias then precession. It is the product rp x rb. 

6746 

6747 5) It is permissible to re-use the same array in the returned 

6748 arguments. The arrays are filled in the order given. 

6749 

6750 Called: 

6751 eraPfw06 bias-precession F-W angles, IAU 2006 

6752 eraFw2m F-W angles to r-matrix 

6753 eraPmat06 PB matrix, IAU 2006 

6754 eraTr transpose r-matrix 

6755 eraRxr product of two r-matrices 

6756 eraCr copy r-matrix 

6757 

6758 References: 

6759 

6760 Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 

6761 

6762 Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 

6763 

6764 This revision: 2021 May 11 

6765 

6766 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6767 Derived, with permission, from the SOFA library. See notes at end of file. 

6768 

6769 """ 

6770 rb, rp, rbp = ufunc.bp06(date1, date2) 

6771 return rb, rp, rbp 

6772 

6773 

6774def bpn2xy(rbpn): 

6775 """ 

6776 Extract from the bias-precession-nutation matrix the X,Y coordinates 

6777 of the Celestial Intermediate Pole. 

6778 

6779 Parameters 

6780 ---------- 

6781 rbpn : double array 

6782 

6783 Returns 

6784 ------- 

6785 x : double array 

6786 y : double array 

6787 

6788 Notes 

6789 ----- 

6790 Wraps ERFA function ``eraBpn2xy``. The ERFA documentation is:: 

6791 

6792 - - - - - - - - - - 

6793 e r a B p n 2 x y 

6794 - - - - - - - - - - 

6795 

6796 Extract from the bias-precession-nutation matrix the X,Y coordinates 

6797 of the Celestial Intermediate Pole. 

6798 

6799 Given: 

6800 rbpn double[3][3] celestial-to-true matrix (Note 1) 

6801 

6802 Returned: 

6803 x,y double Celestial Intermediate Pole (Note 2) 

6804 

6805 Notes: 

6806 

6807 1) The matrix rbpn transforms vectors from GCRS to true equator (and 

6808 CIO or equinox) of date, and therefore the Celestial Intermediate 

6809 Pole unit vector is the bottom row of the matrix. 

6810 

6811 2) The arguments x,y are components of the Celestial Intermediate 

6812 Pole unit vector in the Geocentric Celestial Reference System. 

6813 

6814 Reference: 

6815 

6816 "Expressions for the Celestial Intermediate Pole and Celestial 

6817 Ephemeris Origin consistent with the IAU 2000A precession- 

6818 nutation model", Astron.Astrophys. 400, 1145-1154 

6819 (2003) 

6820 

6821 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

6822 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

6823 

6824 This revision: 2021 May 11 

6825 

6826 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6827 Derived, with permission, from the SOFA library. See notes at end of file. 

6828 

6829 """ 

6830 x, y = ufunc.bpn2xy(rbpn) 

6831 return x, y 

6832 

6833 

6834def c2i00a(date1, date2): 

6835 """ 

6836 Form the celestial-to-intermediate matrix for a given date using the 

6837 IAU 2000A precession-nutation model. 

6838 

6839 Parameters 

6840 ---------- 

6841 date1 : double array 

6842 date2 : double array 

6843 

6844 Returns 

6845 ------- 

6846 rc2i : double array 

6847 

6848 Notes 

6849 ----- 

6850 Wraps ERFA function ``eraC2i00a``. The ERFA documentation is:: 

6851 

6852 - - - - - - - - - - 

6853 e r a C 2 i 0 0 a 

6854 - - - - - - - - - - 

6855 

6856 Form the celestial-to-intermediate matrix for a given date using the 

6857 IAU 2000A precession-nutation model. 

6858 

6859 Given: 

6860 date1,date2 double TT as a 2-part Julian Date (Note 1) 

6861 

6862 Returned: 

6863 rc2i double[3][3] celestial-to-intermediate matrix (Note 2) 

6864 

6865 Notes: 

6866 

6867 1) The TT date date1+date2 is a Julian Date, apportioned in any 

6868 convenient way between the two arguments. For example, 

6869 JD(TT)=2450123.7 could be expressed in any of these ways, 

6870 among others: 

6871 

6872 date1 date2 

6873 

6874 2450123.7 0.0 (JD method) 

6875 2451545.0 -1421.3 (J2000 method) 

6876 2400000.5 50123.2 (MJD method) 

6877 2450123.5 0.2 (date & time method) 

6878 

6879 The JD method is the most natural and convenient to use in 

6880 cases where the loss of several decimal digits of resolution 

6881 is acceptable. The J2000 method is best matched to the way 

6882 the argument is handled internally and will deliver the 

6883 optimum resolution. The MJD method and the date & time methods 

6884 are both good compromises between resolution and convenience. 

6885 

6886 2) The matrix rc2i is the first stage in the transformation from 

6887 celestial to terrestrial coordinates: 

6888 

6889 [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] 

6890 

6891 = rc2t * [CRS] 

6892 

6893 where [CRS] is a vector in the Geocentric Celestial Reference 

6894 System and [TRS] is a vector in the International Terrestrial 

6895 Reference System (see IERS Conventions 2003), ERA is the Earth 

6896 Rotation Angle and RPOM is the polar motion matrix. 

6897 

6898 3) A faster, but slightly less accurate, result (about 1 mas) can be 

6899 obtained by using instead the eraC2i00b function. 

6900 

6901 Called: 

6902 eraPnm00a classical NPB matrix, IAU 2000A 

6903 eraC2ibpn celestial-to-intermediate matrix, given NPB matrix 

6904 

6905 References: 

6906 

6907 "Expressions for the Celestial Intermediate Pole and Celestial 

6908 Ephemeris Origin consistent with the IAU 2000A precession- 

6909 nutation model", Astron.Astrophys. 400, 1145-1154 

6910 (2003) 

6911 

6912 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

6913 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

6914 

6915 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

6916 IERS Technical Note No. 32, BKG (2004) 

6917 

6918 This revision: 2021 May 11 

6919 

6920 Copyright (C) 2013-2021, NumFOCUS Foundation. 

6921 Derived, with permission, from the SOFA library. See notes at end of file. 

6922 

6923 """ 

6924 rc2i = ufunc.c2i00a(date1, date2) 

6925 return rc2i 

6926 

6927 

6928def c2i00b(date1, date2): 

6929 """ 

6930 Form the celestial-to-intermediate matrix for a given date using the 

6931 IAU 2000B precession-nutation model. 

6932 

6933 Parameters 

6934 ---------- 

6935 date1 : double array 

6936 date2 : double array 

6937 

6938 Returns 

6939 ------- 

6940 rc2i : double array 

6941 

6942 Notes 

6943 ----- 

6944 Wraps ERFA function ``eraC2i00b``. The ERFA documentation is:: 

6945 

6946 - - - - - - - - - - 

6947 e r a C 2 i 0 0 b 

6948 - - - - - - - - - - 

6949 

6950 Form the celestial-to-intermediate matrix for a given date using the 

6951 IAU 2000B precession-nutation model. 

6952 

6953 Given: 

6954 date1,date2 double TT as a 2-part Julian Date (Note 1) 

6955 

6956 Returned: 

6957 rc2i double[3][3] celestial-to-intermediate matrix (Note 2) 

6958 

6959 Notes: 

6960 

6961 1) The TT date date1+date2 is a Julian Date, apportioned in any 

6962 convenient way between the two arguments. For example, 

6963 JD(TT)=2450123.7 could be expressed in any of these ways, 

6964 among others: 

6965 

6966 date1 date2 

6967 

6968 2450123.7 0.0 (JD method) 

6969 2451545.0 -1421.3 (J2000 method) 

6970 2400000.5 50123.2 (MJD method) 

6971 2450123.5 0.2 (date & time method) 

6972 

6973 The JD method is the most natural and convenient to use in 

6974 cases where the loss of several decimal digits of resolution 

6975 is acceptable. The J2000 method is best matched to the way 

6976 the argument is handled internally and will deliver the 

6977 optimum resolution. The MJD method and the date & time methods 

6978 are both good compromises between resolution and convenience. 

6979 

6980 2) The matrix rc2i is the first stage in the transformation from 

6981 celestial to terrestrial coordinates: 

6982 

6983 [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] 

6984 

6985 = rc2t * [CRS] 

6986 

6987 where [CRS] is a vector in the Geocentric Celestial Reference 

6988 System and [TRS] is a vector in the International Terrestrial 

6989 Reference System (see IERS Conventions 2003), ERA is the Earth 

6990 Rotation Angle and RPOM is the polar motion matrix. 

6991 

6992 3) The present function is faster, but slightly less accurate (about 

6993 1 mas), than the eraC2i00a function. 

6994 

6995 Called: 

6996 eraPnm00b classical NPB matrix, IAU 2000B 

6997 eraC2ibpn celestial-to-intermediate matrix, given NPB matrix 

6998 

6999 References: 

7000 

7001 "Expressions for the Celestial Intermediate Pole and Celestial 

7002 Ephemeris Origin consistent with the IAU 2000A precession- 

7003 nutation model", Astron.Astrophys. 400, 1145-1154 

7004 (2003) 

7005 

7006 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

7007 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

7008 

7009 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

7010 IERS Technical Note No. 32, BKG (2004) 

7011 

7012 This revision: 2021 May 11 

7013 

7014 Copyright (C) 2013-2021, NumFOCUS Foundation. 

7015 Derived, with permission, from the SOFA library. See notes at end of file. 

7016 

7017 """ 

7018 rc2i = ufunc.c2i00b(date1, date2) 

7019 return rc2i 

7020 

7021 

7022def c2i06a(date1, date2): 

7023 """ 

7024 Form the celestial-to-intermediate matrix for a given date using the 

7025 IAU 2006 precession and IAU 2000A nutation models. 

7026 

7027 Parameters 

7028 ---------- 

7029 date1 : double array 

7030 date2 : double array 

7031 

7032 Returns 

7033 ------- 

7034 rc2i : double array 

7035 

7036 Notes 

7037 ----- 

7038 Wraps ERFA function ``eraC2i06a``. The ERFA documentation is:: 

7039 

7040 - - - - - - - - - - 

7041 e r a C 2 i 0 6 a 

7042 - - - - - - - - - - 

7043 

7044 Form the celestial-to-intermediate matrix for a given date using the 

7045 IAU 2006 precession and IAU 2000A nutation models. 

7046 

7047 Given: 

7048 date1,date2 double TT as a 2-part Julian Date (Note 1) 

7049 

7050 Returned: 

7051 rc2i double[3][3] celestial-to-intermediate matrix (Note 2) 

7052 

7053 Notes: 

7054 

7055 1) The TT date date1+date2 is a Julian Date, apportioned in any 

7056 convenient way between the two arguments. For example, 

7057 JD(TT)=2450123.7 could be expressed in any of these ways, 

7058 among others: 

7059 

7060 date1 date2 

7061 

7062 2450123.7 0.0 (JD method) 

7063 2451545.0 -1421.3 (J2000 method) 

7064 2400000.5 50123.2 (MJD method) 

7065 2450123.5 0.2 (date & time method) 

7066 

7067 The JD method is the most natural and convenient to use in 

7068 cases where the loss of several decimal digits of resolution 

7069 is acceptable. The J2000 method is best matched to the way 

7070 the argument is handled internally and will deliver the 

7071 optimum resolution. The MJD method and the date & time methods 

7072 are both good compromises between resolution and convenience. 

7073 

7074 2) The matrix rc2i is the first stage in the transformation from 

7075 celestial to terrestrial coordinates: 

7076 

7077 [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] 

7078 

7079 = RC2T * [CRS] 

7080 

7081 where [CRS] is a vector in the Geocentric Celestial Reference 

7082 System and [TRS] is a vector in the International Terrestrial 

7083 Reference System (see IERS Conventions 2003), ERA is the Earth 

7084 Rotation Angle and RPOM is the polar motion matrix. 

7085 

7086 Called: 

7087 eraPnm06a classical NPB matrix, IAU 2006/2000A 

7088 eraBpn2xy extract CIP X,Y coordinates from NPB matrix 

7089 eraS06 the CIO locator s, given X,Y, IAU 2006 

7090 eraC2ixys celestial-to-intermediate matrix, given X,Y and s 

7091 

7092 References: 

7093 

7094 McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), 

7095 IERS Technical Note No. 32, BKG 

7096 

7097 This revision: 2021 May 11 

7098 

7099 Copyright (C) 2013-2021, NumFOCUS Foundation. 

7100 Derived, with permission, from the SOFA library. See notes at end of file. 

7101 

7102 """ 

7103 rc2i = ufunc.c2i06a(date1, date2) 

7104 return rc2i 

7105 

7106 

7107def c2ibpn(date1, date2, rbpn): 

7108 """ 

7109 Form the celestial-to-intermediate matrix for a given date given 

7110 the bias-precession-nutation matrix. 

7111 

7112 Parameters 

7113 ---------- 

7114 date1 : double array 

7115 date2 : double array 

7116 rbpn : double array 

7117 

7118 Returns 

7119 ------- 

7120 rc2i : double array 

7121 

7122 Notes 

7123 ----- 

7124 Wraps ERFA function ``eraC2ibpn``. The ERFA documentation is:: 

7125 

7126 - - - - - - - - - - 

7127 e r a C 2 i b p n 

7128 - - - - - - - - - - 

7129 

7130 Form the celestial-to-intermediate matrix for a given date given 

7131 the bias-precession-nutation matrix. IAU 2000. 

7132 

7133 Given: 

7134 date1,date2 double TT as a 2-part Julian Date (Note 1) 

7135 rbpn double[3][3] celestial-to-true matrix (Note 2) 

7136 

7137 Returned: 

7138 rc2i double[3][3] celestial-to-intermediate matrix (Note 3) 

7139 

7140 Notes: 

7141 

7142 1) The TT date date1+date2 is a Julian Date, apportioned in any 

7143 convenient way between the two arguments. For example, 

7144 JD(TT)=2450123.7 could be expressed in any of these ways, 

7145 among others: 

7146 

7147 date1 date2 

7148 

7149 2450123.7 0.0 (JD method) 

7150 2451545.0 -1421.3 (J2000 method) 

7151 2400000.5 50123.2 (MJD method) 

7152 2450123.5 0.2 (date & time method) 

7153 

7154 The JD method is the most natural and convenient to use in 

7155 cases where the loss of several decimal digits of resolution 

7156 is acceptable. The J2000 method is best matched to the way 

7157 the argument is handled internally and will deliver the 

7158 optimum resolution. The MJD method and the date & time methods 

7159 are both good compromises between resolution and convenience. 

7160 

7161 2) The matrix rbpn transforms vectors from GCRS to true equator (and 

7162 CIO or equinox) of date. Only the CIP (bottom row) is used. 

7163 

7164 3) The matrix rc2i is the first stage in the transformation from 

7165 celestial to terrestrial coordinates: 

7166 

7167 [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] 

7168 

7169 = RC2T * [CRS] 

7170 

7171 where [CRS] is a vector in the Geocentric Celestial Reference 

7172 System and [TRS] is a vector in the International Terrestrial 

7173 Reference System (see IERS Conventions 2003), ERA is the Earth 

7174 Rotation Angle and RPOM is the polar motion matrix. 

7175 

7176 4) Although its name does not include "00", This function is in fact 

7177 specific to the IAU 2000 models. 

7178 

7179 Called: 

7180 eraBpn2xy extract CIP X,Y coordinates from NPB matrix 

7181 eraC2ixy celestial-to-intermediate matrix, given X,Y 

7182 

7183 References: 

7184 "Expressions for the Celestial Intermediate Pole and Celestial 

7185 Ephemeris Origin consistent with the IAU 2000A precession- 

7186 nutation model", Astron.Astrophys. 400, 1145-1154 (2003) 

7187 

7188 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

7189 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

7190 

7191 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

7192 IERS Technical Note No. 32, BKG (2004) 

7193 

7194 This revision: 2021 May 11 

7195 

7196 Copyright (C) 2013-2021, NumFOCUS Foundation. 

7197 Derived, with permission, from the SOFA library. See notes at end of file. 

7198 

7199 """ 

7200 rc2i = ufunc.c2ibpn(date1, date2, rbpn) 

7201 return rc2i 

7202 

7203 

7204def c2ixy(date1, date2, x, y): 

7205 """ 

7206 Form the celestial to intermediate-frame-of-date matrix for a given 

7207 date when the CIP X,Y coordinates are known. 

7208 

7209 Parameters 

7210 ---------- 

7211 date1 : double array 

7212 date2 : double array 

7213 x : double array 

7214 y : double array 

7215 

7216 Returns 

7217 ------- 

7218 rc2i : double array 

7219 

7220 Notes 

7221 ----- 

7222 Wraps ERFA function ``eraC2ixy``. The ERFA documentation is:: 

7223 

7224 - - - - - - - - - 

7225 e r a C 2 i x y 

7226 - - - - - - - - - 

7227 

7228 Form the celestial to intermediate-frame-of-date matrix for a given 

7229 date when the CIP X,Y coordinates are known. IAU 2000. 

7230 

7231 Given: 

7232 date1,date2 double TT as a 2-part Julian Date (Note 1) 

7233 x,y double Celestial Intermediate Pole (Note 2) 

7234 

7235 Returned: 

7236 rc2i double[3][3] celestial-to-intermediate matrix (Note 3) 

7237 

7238 Notes: 

7239 

7240 1) The TT date date1+date2 is a Julian Date, apportioned in any 

7241 convenient way between the two arguments. For example, 

7242 JD(TT)=2450123.7 could be expressed in any of these ways, 

7243 among others: 

7244 

7245 date1 date2 

7246 

7247 2450123.7 0.0 (JD method) 

7248 2451545.0 -1421.3 (J2000 method) 

7249 2400000.5 50123.2 (MJD method) 

7250 2450123.5 0.2 (date & time method) 

7251 

7252 The JD method is the most natural and convenient to use in 

7253 cases where the loss of several decimal digits of resolution 

7254 is acceptable. The J2000 method is best matched to the way 

7255 the argument is handled internally and will deliver the 

7256 optimum resolution. The MJD method and the date & time methods 

7257 are both good compromises between resolution and convenience. 

7258 

7259 2) The Celestial Intermediate Pole coordinates are the x,y components 

7260 of the unit vector in the Geocentric Celestial Reference System. 

7261 

7262 3) The matrix rc2i is the first stage in the transformation from 

7263 celestial to terrestrial coordinates: 

7264 

7265 [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] 

7266 

7267 = RC2T * [CRS] 

7268 

7269 where [CRS] is a vector in the Geocentric Celestial Reference 

7270 System and [TRS] is a vector in the International Terrestrial 

7271 Reference System (see IERS Conventions 2003), ERA is the Earth 

7272 Rotation Angle and RPOM is the polar motion matrix. 

7273 

7274 4) Although its name does not include "00", This function is in fact 

7275 specific to the IAU 2000 models. 

7276 

7277 Called: 

7278 eraC2ixys celestial-to-intermediate matrix, given X,Y and s 

7279 eraS00 the CIO locator s, given X,Y, IAU 2000A 

7280 

7281 Reference: 

7282 

7283 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

7284 IERS Technical Note No. 32, BKG (2004) 

7285 

7286 This revision: 2021 May 11 

7287 

7288 Copyright (C) 2013-2021, NumFOCUS Foundation. 

7289 Derived, with permission, from the SOFA library. See notes at end of file. 

7290 

7291 """ 

7292 rc2i = ufunc.c2ixy(date1, date2, x, y) 

7293 return rc2i 

7294 

7295 

7296def c2ixys(x, y, s): 

7297 """ 

7298 Form the celestial to intermediate-frame-of-date matrix given the CIP 

7299 X,Y and the CIO locator s. 

7300 

7301 Parameters 

7302 ---------- 

7303 x : double array 

7304 y : double array 

7305 s : double array 

7306 

7307 Returns 

7308 ------- 

7309 rc2i : double array 

7310 

7311 Notes 

7312 ----- 

7313 Wraps ERFA function ``eraC2ixys``. The ERFA documentation is:: 

7314 

7315 - - - - - - - - - - 

7316 e r a C 2 i x y s 

7317 - - - - - - - - - - 

7318 

7319 Form the celestial to intermediate-frame-of-date matrix given the CIP 

7320 X,Y and the CIO locator s. 

7321 

7322 Given: 

7323 x,y double Celestial Intermediate Pole (Note 1) 

7324 s double the CIO locator s (Note 2) 

7325 

7326 Returned: 

7327 rc2i double[3][3] celestial-to-intermediate matrix (Note 3) 

7328 

7329 Notes: 

7330 

7331 1) The Celestial Intermediate Pole coordinates are the x,y 

7332 components of the unit vector in the Geocentric Celestial 

7333 Reference System. 

7334 

7335 2) The CIO locator s (in radians) positions the Celestial 

7336 Intermediate Origin on the equator of the CIP. 

7337 

7338 3) The matrix rc2i is the first stage in the transformation from 

7339 celestial to terrestrial coordinates: 

7340 

7341 [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] 

7342 

7343 = RC2T * [CRS] 

7344 

7345 where [CRS] is a vector in the Geocentric Celestial Reference 

7346 System and [TRS] is a vector in the International Terrestrial 

7347 Reference System (see IERS Conventions 2003), ERA is the Earth 

7348 Rotation Angle and RPOM is the polar motion matrix. 

7349 

7350 Called: 

7351 eraIr initialize r-matrix to identity 

7352 eraRz rotate around Z-axis 

7353 eraRy rotate around Y-axis 

7354 

7355 Reference: 

7356 

7357 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

7358 IERS Technical Note No. 32, BKG (2004) 

7359 

7360 This revision: 2021 May 11 

7361 

7362 Copyright (C) 2013-2021, NumFOCUS Foundation. 

7363 Derived, with permission, from the SOFA library. See notes at end of file. 

7364 

7365 """ 

7366 rc2i = ufunc.c2ixys(x, y, s) 

7367 return rc2i 

7368 

7369 

7370def c2t00a(tta, ttb, uta, utb, xp, yp): 

7371 """ 

7372 Form the celestial to terrestrial matrix given the date, the UT1 and 

7373 the polar motion, using the IAU 2000A precession-nutation model. 

7374 

7375 Parameters 

7376 ---------- 

7377 tta : double array 

7378 ttb : double array 

7379 uta : double array 

7380 utb : double array 

7381 xp : double array 

7382 yp : double array 

7383 

7384 Returns 

7385 ------- 

7386 rc2t : double array 

7387 

7388 Notes 

7389 ----- 

7390 Wraps ERFA function ``eraC2t00a``. The ERFA documentation is:: 

7391 

7392 - - - - - - - - - - 

7393 e r a C 2 t 0 0 a 

7394 - - - - - - - - - - 

7395 

7396 Form the celestial to terrestrial matrix given the date, the UT1 and 

7397 the polar motion, using the IAU 2000A precession-nutation model. 

7398 

7399 Given: 

7400 tta,ttb double TT as a 2-part Julian Date (Note 1) 

7401 uta,utb double UT1 as a 2-part Julian Date (Note 1) 

7402 xp,yp double CIP coordinates (radians, Note 2) 

7403 

7404 Returned: 

7405 rc2t double[3][3] celestial-to-terrestrial matrix (Note 3) 

7406 

7407 Notes: 

7408 

7409 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates, 

7410 apportioned in any convenient way between the arguments uta and 

7411 utb. For example, JD(UT1)=2450123.7 could be expressed in any of 

7412 these ways, among others: 

7413 

7414 uta utb 

7415 

7416 2450123.7 0.0 (JD method) 

7417 2451545.0 -1421.3 (J2000 method) 

7418 2400000.5 50123.2 (MJD method) 

7419 2450123.5 0.2 (date & time method) 

7420 

7421 The JD method is the most natural and convenient to use in 

7422 cases where the loss of several decimal digits of resolution is 

7423 acceptable. The J2000 and MJD methods are good compromises 

7424 between resolution and convenience. In the case of uta,utb, the 

7425 date & time method is best matched to the Earth rotation angle 

7426 algorithm used: maximum precision is delivered when the uta 

7427 argument is for 0hrs UT1 on the day in question and the utb 

7428 argument lies in the range 0 to 1, or vice versa. 

7429 

7430 2) The arguments xp and yp are the coordinates (in radians) of the 

7431 Celestial Intermediate Pole with respect to the International 

7432 Terrestrial Reference System (see IERS Conventions 2003), 

7433 measured along the meridians 0 and 90 deg west respectively. 

7434 

7435 3) The matrix rc2t transforms from celestial to terrestrial 

7436 coordinates: 

7437 

7438 [TRS] = RPOM * R_3(ERA) * RC2I * [CRS] 

7439 

7440 = rc2t * [CRS] 

7441 

7442 where [CRS] is a vector in the Geocentric Celestial Reference 

7443 System and [TRS] is a vector in the International Terrestrial 

7444 Reference System (see IERS Conventions 2003), RC2I is the 

7445 celestial-to-intermediate matrix, ERA is the Earth rotation 

7446 angle and RPOM is the polar motion matrix. 

7447 

7448 4) A faster, but slightly less accurate, result (about 1 mas) can 

7449 be obtained by using instead the eraC2t00b function. 

7450 

7451 Called: 

7452 eraC2i00a celestial-to-intermediate matrix, IAU 2000A 

7453 eraEra00 Earth rotation angle, IAU 2000 

7454 eraSp00 the TIO locator s', IERS 2000 

7455 eraPom00 polar motion matrix 

7456 eraC2tcio form CIO-based celestial-to-terrestrial matrix 

7457 

7458 Reference: 

7459 

7460 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

7461 IERS Technical Note No. 32, BKG (2004) 

7462 

7463 This revision: 2021 May 11 

7464 

7465 Copyright (C) 2013-2021, NumFOCUS Foundation. 

7466 Derived, with permission, from the SOFA library. See notes at end of file. 

7467 

7468 """ 

7469 rc2t = ufunc.c2t00a(tta, ttb, uta, utb, xp, yp) 

7470 return rc2t 

7471 

7472 

7473def c2t00b(tta, ttb, uta, utb, xp, yp): 

7474 """ 

7475 Form the celestial to terrestrial matrix given the date, the UT1 and 

7476 the polar motion, using the IAU 2000B precession-nutation model. 

7477 

7478 Parameters 

7479 ---------- 

7480 tta : double array 

7481 ttb : double array 

7482 uta : double array 

7483 utb : double array 

7484 xp : double array 

7485 yp : double array 

7486 

7487 Returns 

7488 ------- 

7489 rc2t : double array 

7490 

7491 Notes 

7492 ----- 

7493 Wraps ERFA function ``eraC2t00b``. The ERFA documentation is:: 

7494 

7495 - - - - - - - - - - 

7496 e r a C 2 t 0 0 b 

7497 - - - - - - - - - - 

7498 

7499 Form the celestial to terrestrial matrix given the date, the UT1 and 

7500 the polar motion, using the IAU 2000B precession-nutation model. 

7501 

7502 Given: 

7503 tta,ttb double TT as a 2-part Julian Date (Note 1) 

7504 uta,utb double UT1 as a 2-part Julian Date (Note 1) 

7505 xp,yp double coordinates of the pole (radians, Note 2) 

7506 

7507 Returned: 

7508 rc2t double[3][3] celestial-to-terrestrial matrix (Note 3) 

7509 

7510 Notes: 

7511 

7512 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates, 

7513 apportioned in any convenient way between the arguments uta and 

7514 utb. For example, JD(UT1)=2450123.7 could be expressed in any of 

7515 these ways, among others: 

7516 

7517 uta utb 

7518 

7519 2450123.7 0.0 (JD method) 

7520 2451545.0 -1421.3 (J2000 method) 

7521 2400000.5 50123.2 (MJD method) 

7522 2450123.5 0.2 (date & time method) 

7523 

7524 The JD method is the most natural and convenient to use in 

7525 cases where the loss of several decimal digits of resolution is 

7526 acceptable. The J2000 and MJD methods are good compromises 

7527 between resolution and convenience. In the case of uta,utb, the 

7528 date & time method is best matched to the Earth rotation angle 

7529 algorithm used: maximum precision is delivered when the uta 

7530 argument is for 0hrs UT1 on the day in question and the utb 

7531 argument lies in the range 0 to 1, or vice versa. 

7532 

7533 2) The arguments xp and yp are the coordinates (in radians) of the 

7534 Celestial Intermediate Pole with respect to the International 

7535 Terrestrial Reference System (see IERS Conventions 2003), 

7536 measured along the meridians 0 and 90 deg west respectively. 

7537 

7538 3) The matrix rc2t transforms from celestial to terrestrial 

7539 coordinates: 

7540 

7541 [TRS] = RPOM * R_3(ERA) * RC2I * [CRS] 

7542 

7543 = rc2t * [CRS] 

7544 

7545 where [CRS] is a vector in the Geocentric Celestial Reference 

7546 System and [TRS] is a vector in the International Terrestrial 

7547 Reference System (see IERS Conventions 2003), RC2I is the 

7548 celestial-to-intermediate matrix, ERA is the Earth rotation 

7549 angle and RPOM is the polar motion matrix. 

7550 

7551 4) The present function is faster, but slightly less accurate (about 

7552 1 mas), than the eraC2t00a function. 

7553 

7554 Called: 

7555 eraC2i00b celestial-to-intermediate matrix, IAU 2000B 

7556 eraEra00 Earth rotation angle, IAU 2000 

7557 eraPom00 polar motion matrix 

7558 eraC2tcio form CIO-based celestial-to-terrestrial matrix 

7559 

7560 Reference: 

7561 

7562 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

7563 IERS Technical Note No. 32, BKG (2004) 

7564 

7565 This revision: 2021 May 11 

7566 

7567 Copyright (C) 2013-2021, NumFOCUS Foundation. 

7568 Derived, with permission, from the SOFA library. See notes at end of file. 

7569 

7570 """ 

7571 rc2t = ufunc.c2t00b(tta, ttb, uta, utb, xp, yp) 

7572 return rc2t 

7573 

7574 

7575def c2t06a(tta, ttb, uta, utb, xp, yp): 

7576 """ 

7577 Form the celestial to terrestrial matrix given the date, the UT1 and 

7578 the polar motion, using the IAU 2006/2000A precession-nutation 

7579 model. 

7580 

7581 Parameters 

7582 ---------- 

7583 tta : double array 

7584 ttb : double array 

7585 uta : double array 

7586 utb : double array 

7587 xp : double array 

7588 yp : double array 

7589 

7590 Returns 

7591 ------- 

7592 rc2t : double array 

7593 

7594 Notes 

7595 ----- 

7596 Wraps ERFA function ``eraC2t06a``. The ERFA documentation is:: 

7597 

7598 - - - - - - - - - - 

7599 e r a C 2 t 0 6 a 

7600 - - - - - - - - - - 

7601 

7602 Form the celestial to terrestrial matrix given the date, the UT1 and 

7603 the polar motion, using the IAU 2006/2000A precession-nutation 

7604 model. 

7605 

7606 Given: 

7607 tta,ttb double TT as a 2-part Julian Date (Note 1) 

7608 uta,utb double UT1 as a 2-part Julian Date (Note 1) 

7609 xp,yp double coordinates of the pole (radians, Note 2) 

7610 

7611 Returned: 

7612 rc2t double[3][3] celestial-to-terrestrial matrix (Note 3) 

7613 

7614 Notes: 

7615 

7616 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates, 

7617 apportioned in any convenient way between the arguments uta and 

7618 utb. For example, JD(UT1)=2450123.7 could be expressed in any of 

7619 these ways, among others: 

7620 

7621 uta utb 

7622 

7623 2450123.7 0.0 (JD method) 

7624 2451545.0 -1421.3 (J2000 method) 

7625 2400000.5 50123.2 (MJD method) 

7626 2450123.5 0.2 (date & time method) 

7627 

7628 The JD method is the most natural and convenient to use in 

7629 cases where the loss of several decimal digits of resolution is 

7630 acceptable. The J2000 and MJD methods are good compromises 

7631 between resolution and convenience. In the case of uta,utb, the 

7632 date & time method is best matched to the Earth rotation angle 

7633 algorithm used: maximum precision is delivered when the uta 

7634 argument is for 0hrs UT1 on the day in question and the utb 

7635 argument lies in the range 0 to 1, or vice versa. 

7636 

7637 2) The arguments xp and yp are the coordinates (in radians) of the 

7638 Celestial Intermediate Pole with respect to the International 

7639 Terrestrial Reference System (see IERS Conventions 2003), 

7640 measured along the meridians 0 and 90 deg west respectively. 

7641 

7642 3) The matrix rc2t transforms from celestial to terrestrial 

7643 coordinates: 

7644 

7645 [TRS] = RPOM * R_3(ERA) * RC2I * [CRS] 

7646 

7647 = rc2t * [CRS] 

7648 

7649 where [CRS] is a vector in the Geocentric Celestial Reference 

7650 System and [TRS] is a vector in the International Terrestrial 

7651 Reference System (see IERS Conventions 2003), RC2I is the 

7652 celestial-to-intermediate matrix, ERA is the Earth rotation 

7653 angle and RPOM is the polar motion matrix. 

7654 

7655 Called: 

7656 eraC2i06a celestial-to-intermediate matrix, IAU 2006/2000A 

7657 eraEra00 Earth rotation angle, IAU 2000 

7658 eraSp00 the TIO locator s', IERS 2000 

7659 eraPom00 polar motion matrix 

7660 eraC2tcio form CIO-based celestial-to-terrestrial matrix 

7661 

7662 Reference: 

7663 

7664 McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), 

7665 IERS Technical Note No. 32, BKG 

7666 

7667 This revision: 2021 May 11 

7668 

7669 Copyright (C) 2013-2021, NumFOCUS Foundation. 

7670 Derived, with permission, from the SOFA library. See notes at end of file. 

7671 

7672 """ 

7673 rc2t = ufunc.c2t06a(tta, ttb, uta, utb, xp, yp) 

7674 return rc2t 

7675 

7676 

7677def c2tcio(rc2i, era, rpom): 

7678 """ 

7679 Assemble the celestial to terrestrial matrix from CIO-based 

7680 components (the celestial-to-intermediate matrix, the Earth Rotation 

7681 Angle and the polar motion matrix). 

7682 

7683 Parameters 

7684 ---------- 

7685 rc2i : double array 

7686 era : double array 

7687 rpom : double array 

7688 

7689 Returns 

7690 ------- 

7691 rc2t : double array 

7692 

7693 Notes 

7694 ----- 

7695 Wraps ERFA function ``eraC2tcio``. The ERFA documentation is:: 

7696 

7697 - - - - - - - - - - 

7698 e r a C 2 t c i o 

7699 - - - - - - - - - - 

7700 

7701 Assemble the celestial to terrestrial matrix from CIO-based 

7702 components (the celestial-to-intermediate matrix, the Earth Rotation 

7703 Angle and the polar motion matrix). 

7704 

7705 Given: 

7706 rc2i double[3][3] celestial-to-intermediate matrix 

7707 era double Earth rotation angle (radians) 

7708 rpom double[3][3] polar-motion matrix 

7709 

7710 Returned: 

7711 rc2t double[3][3] celestial-to-terrestrial matrix 

7712 

7713 Notes: 

7714 

7715 1) This function constructs the rotation matrix that transforms 

7716 vectors in the celestial system into vectors in the terrestrial 

7717 system. It does so starting from precomputed components, namely 

7718 the matrix which rotates from celestial coordinates to the 

7719 intermediate frame, the Earth rotation angle and the polar motion 

7720 matrix. One use of the present function is when generating a 

7721 series of celestial-to-terrestrial matrices where only the Earth 

7722 Rotation Angle changes, avoiding the considerable overhead of 

7723 recomputing the precession-nutation more often than necessary to 

7724 achieve given accuracy objectives. 

7725 

7726 2) The relationship between the arguments is as follows: 

7727 

7728 [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] 

7729 

7730 = rc2t * [CRS] 

7731 

7732 where [CRS] is a vector in the Geocentric Celestial Reference 

7733 System and [TRS] is a vector in the International Terrestrial 

7734 Reference System (see IERS Conventions 2003). 

7735 

7736 Called: 

7737 eraCr copy r-matrix 

7738 eraRz rotate around Z-axis 

7739 eraRxr product of two r-matrices 

7740 

7741 Reference: 

7742 

7743 McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), 

7744 IERS Technical Note No. 32, BKG 

7745 

7746 This revision: 2021 May 11 

7747 

7748 Copyright (C) 2013-2021, NumFOCUS Foundation. 

7749 Derived, with permission, from the SOFA library. See notes at end of file. 

7750 

7751 """ 

7752 rc2t = ufunc.c2tcio(rc2i, era, rpom) 

7753 return rc2t 

7754 

7755 

7756def c2teqx(rbpn, gst, rpom): 

7757 """ 

7758 Assemble the celestial to terrestrial matrix from equinox-based 

7759 components (the celestial-to-true matrix, the Greenwich Apparent 

7760 Sidereal Time and the polar motion matrix). 

7761 

7762 Parameters 

7763 ---------- 

7764 rbpn : double array 

7765 gst : double array 

7766 rpom : double array 

7767 

7768 Returns 

7769 ------- 

7770 rc2t : double array 

7771 

7772 Notes 

7773 ----- 

7774 Wraps ERFA function ``eraC2teqx``. The ERFA documentation is:: 

7775 

7776 - - - - - - - - - - 

7777 e r a C 2 t e q x 

7778 - - - - - - - - - - 

7779 

7780 Assemble the celestial to terrestrial matrix from equinox-based 

7781 components (the celestial-to-true matrix, the Greenwich Apparent 

7782 Sidereal Time and the polar motion matrix). 

7783 

7784 Given: 

7785 rbpn double[3][3] celestial-to-true matrix 

7786 gst double Greenwich (apparent) Sidereal Time (radians) 

7787 rpom double[3][3] polar-motion matrix 

7788 

7789 Returned: 

7790 rc2t double[3][3] celestial-to-terrestrial matrix (Note 2) 

7791 

7792 Notes: 

7793 

7794 1) This function constructs the rotation matrix that transforms 

7795 vectors in the celestial system into vectors in the terrestrial 

7796 system. It does so starting from precomputed components, namely 

7797 the matrix which rotates from celestial coordinates to the 

7798 true equator and equinox of date, the Greenwich Apparent Sidereal 

7799 Time and the polar motion matrix. One use of the present function 

7800 is when generating a series of celestial-to-terrestrial matrices 

7801 where only the Sidereal Time changes, avoiding the considerable 

7802 overhead of recomputing the precession-nutation more often than 

7803 necessary to achieve given accuracy objectives. 

7804 

7805 2) The relationship between the arguments is as follows: 

7806 

7807 [TRS] = rpom * R_3(gst) * rbpn * [CRS] 

7808 

7809 = rc2t * [CRS] 

7810 

7811 where [CRS] is a vector in the Geocentric Celestial Reference 

7812 System and [TRS] is a vector in the International Terrestrial 

7813 Reference System (see IERS Conventions 2003). 

7814 

7815 Called: 

7816 eraCr copy r-matrix 

7817 eraRz rotate around Z-axis 

7818 eraRxr product of two r-matrices 

7819 

7820 Reference: 

7821 

7822 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

7823 IERS Technical Note No. 32, BKG (2004) 

7824 

7825 This revision: 2021 May 11 

7826 

7827 Copyright (C) 2013-2021, NumFOCUS Foundation. 

7828 Derived, with permission, from the SOFA library. See notes at end of file. 

7829 

7830 """ 

7831 rc2t = ufunc.c2teqx(rbpn, gst, rpom) 

7832 return rc2t 

7833 

7834 

7835def c2tpe(tta, ttb, uta, utb, dpsi, deps, xp, yp): 

7836 """ 

7837 Form the celestial to terrestrial matrix given the date, the UT1, 

7838 the nutation and the polar motion. 

7839 

7840 Parameters 

7841 ---------- 

7842 tta : double array 

7843 ttb : double array 

7844 uta : double array 

7845 utb : double array 

7846 dpsi : double array 

7847 deps : double array 

7848 xp : double array 

7849 yp : double array 

7850 

7851 Returns 

7852 ------- 

7853 rc2t : double array 

7854 

7855 Notes 

7856 ----- 

7857 Wraps ERFA function ``eraC2tpe``. The ERFA documentation is:: 

7858 

7859 - - - - - - - - - 

7860 e r a C 2 t p e 

7861 - - - - - - - - - 

7862 

7863 Form the celestial to terrestrial matrix given the date, the UT1, 

7864 the nutation and the polar motion. IAU 2000. 

7865 

7866 Given: 

7867 tta,ttb double TT as a 2-part Julian Date (Note 1) 

7868 uta,utb double UT1 as a 2-part Julian Date (Note 1) 

7869 dpsi,deps double nutation (Note 2) 

7870 xp,yp double coordinates of the pole (radians, Note 3) 

7871 

7872 Returned: 

7873 rc2t double[3][3] celestial-to-terrestrial matrix (Note 4) 

7874 

7875 Notes: 

7876 

7877 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates, 

7878 apportioned in any convenient way between the arguments uta and 

7879 utb. For example, JD(UT1)=2450123.7 could be expressed in any of 

7880 these ways, among others: 

7881 

7882 uta utb 

7883 

7884 2450123.7 0.0 (JD method) 

7885 2451545.0 -1421.3 (J2000 method) 

7886 2400000.5 50123.2 (MJD method) 

7887 2450123.5 0.2 (date & time method) 

7888 

7889 The JD method is the most natural and convenient to use in 

7890 cases where the loss of several decimal digits of resolution is 

7891 acceptable. The J2000 and MJD methods are good compromises 

7892 between resolution and convenience. In the case of uta,utb, the 

7893 date & time method is best matched to the Earth rotation angle 

7894 algorithm used: maximum precision is delivered when the uta 

7895 argument is for 0hrs UT1 on the day in question and the utb 

7896 argument lies in the range 0 to 1, or vice versa. 

7897 

7898 2) The caller is responsible for providing the nutation components; 

7899 they are in longitude and obliquity, in radians and are with 

7900 respect to the equinox and ecliptic of date. For high-accuracy 

7901 applications, free core nutation should be included as well as 

7902 any other relevant corrections to the position of the CIP. 

7903 

7904 3) The arguments xp and yp are the coordinates (in radians) of the 

7905 Celestial Intermediate Pole with respect to the International 

7906 Terrestrial Reference System (see IERS Conventions 2003), 

7907 measured along the meridians 0 and 90 deg west respectively. 

7908 

7909 4) The matrix rc2t transforms from celestial to terrestrial 

7910 coordinates: 

7911 

7912 [TRS] = RPOM * R_3(GST) * RBPN * [CRS] 

7913 

7914 = rc2t * [CRS] 

7915 

7916 where [CRS] is a vector in the Geocentric Celestial Reference 

7917 System and [TRS] is a vector in the International Terrestrial 

7918 Reference System (see IERS Conventions 2003), RBPN is the 

7919 bias-precession-nutation matrix, GST is the Greenwich (apparent) 

7920 Sidereal Time and RPOM is the polar motion matrix. 

7921 

7922 5) Although its name does not include "00", This function is in fact 

7923 specific to the IAU 2000 models. 

7924 

7925 Called: 

7926 eraPn00 bias/precession/nutation results, IAU 2000 

7927 eraGmst00 Greenwich mean sidereal time, IAU 2000 

7928 eraSp00 the TIO locator s', IERS 2000 

7929 eraEe00 equation of the equinoxes, IAU 2000 

7930 eraPom00 polar motion matrix 

7931 eraC2teqx form equinox-based celestial-to-terrestrial matrix 

7932 

7933 Reference: 

7934 

7935 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

7936 IERS Technical Note No. 32, BKG (2004) 

7937 

7938 This revision: 2021 May 11 

7939 

7940 Copyright (C) 2013-2021, NumFOCUS Foundation. 

7941 Derived, with permission, from the SOFA library. See notes at end of file. 

7942 

7943 """ 

7944 rc2t = ufunc.c2tpe(tta, ttb, uta, utb, dpsi, deps, xp, yp) 

7945 return rc2t 

7946 

7947 

7948def c2txy(tta, ttb, uta, utb, x, y, xp, yp): 

7949 """ 

7950 Form the celestial to terrestrial matrix given the date, the UT1, 

7951 the CIP coordinates and the polar motion. 

7952 

7953 Parameters 

7954 ---------- 

7955 tta : double array 

7956 ttb : double array 

7957 uta : double array 

7958 utb : double array 

7959 x : double array 

7960 y : double array 

7961 xp : double array 

7962 yp : double array 

7963 

7964 Returns 

7965 ------- 

7966 rc2t : double array 

7967 

7968 Notes 

7969 ----- 

7970 Wraps ERFA function ``eraC2txy``. The ERFA documentation is:: 

7971 

7972 - - - - - - - - - 

7973 e r a C 2 t x y 

7974 - - - - - - - - - 

7975 

7976 Form the celestial to terrestrial matrix given the date, the UT1, 

7977 the CIP coordinates and the polar motion. IAU 2000. 

7978 

7979 Given: 

7980 tta,ttb double TT as a 2-part Julian Date (Note 1) 

7981 uta,utb double UT1 as a 2-part Julian Date (Note 1) 

7982 x,y double Celestial Intermediate Pole (Note 2) 

7983 xp,yp double coordinates of the pole (radians, Note 3) 

7984 

7985 Returned: 

7986 rc2t double[3][3] celestial-to-terrestrial matrix (Note 4) 

7987 

7988 Notes: 

7989 

7990 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates, 

7991 apportioned in any convenient way between the arguments uta and 

7992 utb. For example, JD(UT1)=2450123.7 could be expressed in any o 

7993 these ways, among others: 

7994 

7995 uta utb 

7996 

7997 2450123.7 0.0 (JD method) 

7998 2451545.0 -1421.3 (J2000 method) 

7999 2400000.5 50123.2 (MJD method) 

8000 2450123.5 0.2 (date & time method) 

8001 

8002 The JD method is the most natural and convenient to use in 

8003 cases where the loss of several decimal digits of resolution is 

8004 acceptable. The J2000 and MJD methods are good compromises 

8005 between resolution and convenience. In the case of uta,utb, the 

8006 date & time method is best matched to the Earth rotation angle 

8007 algorithm used: maximum precision is delivered when the uta 

8008 argument is for 0hrs UT1 on the day in question and the utb 

8009 argument lies in the range 0 to 1, or vice versa. 

8010 

8011 2) The Celestial Intermediate Pole coordinates are the x,y 

8012 components of the unit vector in the Geocentric Celestial 

8013 Reference System. 

8014 

8015 3) The arguments xp and yp are the coordinates (in radians) of the 

8016 Celestial Intermediate Pole with respect to the International 

8017 Terrestrial Reference System (see IERS Conventions 2003), 

8018 measured along the meridians 0 and 90 deg west respectively. 

8019 

8020 4) The matrix rc2t transforms from celestial to terrestrial 

8021 coordinates: 

8022 

8023 [TRS] = RPOM * R_3(ERA) * RC2I * [CRS] 

8024 

8025 = rc2t * [CRS] 

8026 

8027 where [CRS] is a vector in the Geocentric Celestial Reference 

8028 System and [TRS] is a vector in the International Terrestrial 

8029 Reference System (see IERS Conventions 2003), ERA is the Earth 

8030 Rotation Angle and RPOM is the polar motion matrix. 

8031 

8032 5) Although its name does not include "00", This function is in fact 

8033 specific to the IAU 2000 models. 

8034 

8035 Called: 

8036 eraC2ixy celestial-to-intermediate matrix, given X,Y 

8037 eraEra00 Earth rotation angle, IAU 2000 

8038 eraSp00 the TIO locator s', IERS 2000 

8039 eraPom00 polar motion matrix 

8040 eraC2tcio form CIO-based celestial-to-terrestrial matrix 

8041 

8042 Reference: 

8043 

8044 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

8045 IERS Technical Note No. 32, BKG (2004) 

8046 

8047 This revision: 2021 May 11 

8048 

8049 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8050 Derived, with permission, from the SOFA library. See notes at end of file. 

8051 

8052 """ 

8053 rc2t = ufunc.c2txy(tta, ttb, uta, utb, x, y, xp, yp) 

8054 return rc2t 

8055 

8056 

8057def eo06a(date1, date2): 

8058 """ 

8059 Equation of the origins, IAU 2006 precession and IAU 2000A nutation. 

8060 

8061 Parameters 

8062 ---------- 

8063 date1 : double array 

8064 date2 : double array 

8065 

8066 Returns 

8067 ------- 

8068 c_retval : double array 

8069 

8070 Notes 

8071 ----- 

8072 Wraps ERFA function ``eraEo06a``. The ERFA documentation is:: 

8073 

8074 - - - - - - - - - 

8075 e r a E o 0 6 a 

8076 - - - - - - - - - 

8077 

8078 Equation of the origins, IAU 2006 precession and IAU 2000A nutation. 

8079 

8080 Given: 

8081 date1,date2 double TT as a 2-part Julian Date (Note 1) 

8082 

8083 Returned (function value): 

8084 double the equation of the origins in radians 

8085 

8086 Notes: 

8087 

8088 1) The TT date date1+date2 is a Julian Date, apportioned in any 

8089 convenient way between the two arguments. For example, 

8090 JD(TT)=2450123.7 could be expressed in any of these ways, 

8091 among others: 

8092 

8093 date1 date2 

8094 

8095 2450123.7 0.0 (JD method) 

8096 2451545.0 -1421.3 (J2000 method) 

8097 2400000.5 50123.2 (MJD method) 

8098 2450123.5 0.2 (date & time method) 

8099 

8100 The JD method is the most natural and convenient to use in 

8101 cases where the loss of several decimal digits of resolution 

8102 is acceptable. The J2000 method is best matched to the way 

8103 the argument is handled internally and will deliver the 

8104 optimum resolution. The MJD method and the date & time methods 

8105 are both good compromises between resolution and convenience. 

8106 

8107 2) The equation of the origins is the distance between the true 

8108 equinox and the celestial intermediate origin and, equivalently, 

8109 the difference between Earth rotation angle and Greenwich 

8110 apparent sidereal time (ERA-GST). It comprises the precession 

8111 (since J2000.0) in right ascension plus the equation of the 

8112 equinoxes (including the small correction terms). 

8113 

8114 Called: 

8115 eraPnm06a classical NPB matrix, IAU 2006/2000A 

8116 eraBpn2xy extract CIP X,Y coordinates from NPB matrix 

8117 eraS06 the CIO locator s, given X,Y, IAU 2006 

8118 eraEors equation of the origins, given NPB matrix and s 

8119 

8120 References: 

8121 

8122 Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 

8123 

8124 Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 

8125 

8126 This revision: 2021 May 11 

8127 

8128 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8129 Derived, with permission, from the SOFA library. See notes at end of file. 

8130 

8131 """ 

8132 c_retval = ufunc.eo06a(date1, date2) 

8133 return c_retval 

8134 

8135 

8136def eors(rnpb, s): 

8137 """ 

8138 Equation of the origins, given the classical NPB matrix and the 

8139 quantity s. 

8140 

8141 Parameters 

8142 ---------- 

8143 rnpb : double array 

8144 s : double array 

8145 

8146 Returns 

8147 ------- 

8148 c_retval : double array 

8149 

8150 Notes 

8151 ----- 

8152 Wraps ERFA function ``eraEors``. The ERFA documentation is:: 

8153 

8154 - - - - - - - - 

8155 e r a E o r s 

8156 - - - - - - - - 

8157 

8158 Equation of the origins, given the classical NPB matrix and the 

8159 quantity s. 

8160 

8161 Given: 

8162 rnpb double[3][3] classical nutation x precession x bias matrix 

8163 s double the quantity s (the CIO locator) in radians 

8164 

8165 Returned (function value): 

8166 double the equation of the origins in radians 

8167 

8168 Notes: 

8169 

8170 1) The equation of the origins is the distance between the true 

8171 equinox and the celestial intermediate origin and, equivalently, 

8172 the difference between Earth rotation angle and Greenwich 

8173 apparent sidereal time (ERA-GST). It comprises the precession 

8174 (since J2000.0) in right ascension plus the equation of the 

8175 equinoxes (including the small correction terms). 

8176 

8177 2) The algorithm is from Wallace & Capitaine (2006). 

8178 

8179 References: 

8180 

8181 Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 

8182 

8183 Wallace, P. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 

8184 

8185 This revision: 2021 May 11 

8186 

8187 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8188 Derived, with permission, from the SOFA library. See notes at end of file. 

8189 

8190 """ 

8191 c_retval = ufunc.eors(rnpb, s) 

8192 return c_retval 

8193 

8194 

8195def fw2m(gamb, phib, psi, eps): 

8196 """ 

8197 Form rotation matrix given the Fukushima-Williams angles. 

8198 

8199 Parameters 

8200 ---------- 

8201 gamb : double array 

8202 phib : double array 

8203 psi : double array 

8204 eps : double array 

8205 

8206 Returns 

8207 ------- 

8208 r : double array 

8209 

8210 Notes 

8211 ----- 

8212 Wraps ERFA function ``eraFw2m``. The ERFA documentation is:: 

8213 

8214 - - - - - - - - 

8215 e r a F w 2 m 

8216 - - - - - - - - 

8217 

8218 Form rotation matrix given the Fukushima-Williams angles. 

8219 

8220 Given: 

8221 gamb double F-W angle gamma_bar (radians) 

8222 phib double F-W angle phi_bar (radians) 

8223 psi double F-W angle psi (radians) 

8224 eps double F-W angle epsilon (radians) 

8225 

8226 Returned: 

8227 r double[3][3] rotation matrix 

8228 

8229 Notes: 

8230 

8231 1) Naming the following points: 

8232 

8233 e = J2000.0 ecliptic pole, 

8234 p = GCRS pole, 

8235 E = ecliptic pole of date, 

8236 and P = CIP, 

8237 

8238 the four Fukushima-Williams angles are as follows: 

8239 

8240 gamb = gamma = epE 

8241 phib = phi = pE 

8242 psi = psi = pEP 

8243 eps = epsilon = EP 

8244 

8245 2) The matrix representing the combined effects of frame bias, 

8246 precession and nutation is: 

8247 

8248 NxPxB = R_1(-eps).R_3(-psi).R_1(phib).R_3(gamb) 

8249 

8250 3) The present function can construct three different matrices, 

8251 depending on which angles are supplied as the arguments gamb, 

8252 phib, psi and eps: 

8253 

8254 o To obtain the nutation x precession x frame bias matrix, 

8255 first generate the four precession angles known conventionally 

8256 as gamma_bar, phi_bar, psi_bar and epsilon_A, then generate 

8257 the nutation components Dpsi and Depsilon and add them to 

8258 psi_bar and epsilon_A, and finally call the present function 

8259 using those four angles as arguments. 

8260 

8261 o To obtain the precession x frame bias matrix, generate the 

8262 four precession angles and call the present function. 

8263 

8264 o To obtain the frame bias matrix, generate the four precession 

8265 angles for date J2000.0 and call the present function. 

8266 

8267 The nutation-only and precession-only matrices can if necessary 

8268 be obtained by combining these three appropriately. 

8269 

8270 Called: 

8271 eraIr initialize r-matrix to identity 

8272 eraRz rotate around Z-axis 

8273 eraRx rotate around X-axis 

8274 

8275 References: 

8276 

8277 Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 

8278 

8279 Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351 

8280 

8281 This revision: 2021 May 11 

8282 

8283 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8284 Derived, with permission, from the SOFA library. See notes at end of file. 

8285 

8286 """ 

8287 r = ufunc.fw2m(gamb, phib, psi, eps) 

8288 return r 

8289 

8290 

8291def fw2xy(gamb, phib, psi, eps): 

8292 """ 

8293 CIP X,Y given Fukushima-Williams bias-precession-nutation angles. 

8294 

8295 Parameters 

8296 ---------- 

8297 gamb : double array 

8298 phib : double array 

8299 psi : double array 

8300 eps : double array 

8301 

8302 Returns 

8303 ------- 

8304 x : double array 

8305 y : double array 

8306 

8307 Notes 

8308 ----- 

8309 Wraps ERFA function ``eraFw2xy``. The ERFA documentation is:: 

8310 

8311 - - - - - - - - - 

8312 e r a F w 2 x y 

8313 - - - - - - - - - 

8314 

8315 CIP X,Y given Fukushima-Williams bias-precession-nutation angles. 

8316 

8317 Given: 

8318 gamb double F-W angle gamma_bar (radians) 

8319 phib double F-W angle phi_bar (radians) 

8320 psi double F-W angle psi (radians) 

8321 eps double F-W angle epsilon (radians) 

8322 

8323 Returned: 

8324 x,y double CIP unit vector X,Y 

8325 

8326 Notes: 

8327 

8328 1) Naming the following points: 

8329 

8330 e = J2000.0 ecliptic pole, 

8331 p = GCRS pole 

8332 E = ecliptic pole of date, 

8333 and P = CIP, 

8334 

8335 the four Fukushima-Williams angles are as follows: 

8336 

8337 gamb = gamma = epE 

8338 phib = phi = pE 

8339 psi = psi = pEP 

8340 eps = epsilon = EP 

8341 

8342 2) The matrix representing the combined effects of frame bias, 

8343 precession and nutation is: 

8344 

8345 NxPxB = R_1(-epsA).R_3(-psi).R_1(phib).R_3(gamb) 

8346 

8347 The returned values x,y are elements [2][0] and [2][1] of the 

8348 matrix. Near J2000.0, they are essentially angles in radians. 

8349 

8350 Called: 

8351 eraFw2m F-W angles to r-matrix 

8352 eraBpn2xy extract CIP X,Y coordinates from NPB matrix 

8353 

8354 Reference: 

8355 

8356 Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351 

8357 

8358 This revision: 2021 May 11 

8359 

8360 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8361 Derived, with permission, from the SOFA library. See notes at end of file. 

8362 

8363 """ 

8364 x, y = ufunc.fw2xy(gamb, phib, psi, eps) 

8365 return x, y 

8366 

8367 

8368def ltp(epj): 

8369 """ 

8370 Long-term precession matrix. 

8371 

8372 Parameters 

8373 ---------- 

8374 epj : double array 

8375 

8376 Returns 

8377 ------- 

8378 rp : double array 

8379 

8380 Notes 

8381 ----- 

8382 Wraps ERFA function ``eraLtp``. The ERFA documentation is:: 

8383 

8384 - - - - - - - 

8385 e r a L t p 

8386 - - - - - - - 

8387 

8388 Long-term precession matrix. 

8389 

8390 Given: 

8391 epj double Julian epoch (TT) 

8392 

8393 Returned: 

8394 rp double[3][3] precession matrix, J2000.0 to date 

8395 

8396 Notes: 

8397 

8398 1) The matrix is in the sense 

8399 

8400 P_date = rp x P_J2000, 

8401 

8402 where P_J2000 is a vector with respect to the J2000.0 mean 

8403 equator and equinox and P_date is the same vector with respect to 

8404 the equator and equinox of epoch epj. 

8405 

8406 2) The Vondrak et al. (2011, 2012) 400 millennia precession model 

8407 agrees with the IAU 2006 precession at J2000.0 and stays within 

8408 100 microarcseconds during the 20th and 21st centuries. It is 

8409 accurate to a few arcseconds throughout the historical period, 

8410 worsening to a few tenths of a degree at the end of the 

8411 +/- 200,000 year time span. 

8412 

8413 Called: 

8414 eraLtpequ equator pole, long term 

8415 eraLtpecl ecliptic pole, long term 

8416 eraPxp vector product 

8417 eraPn normalize vector 

8418 

8419 References: 

8420 

8421 Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession 

8422 expressions, valid for long time intervals, Astron.Astrophys. 534, 

8423 A22 

8424 

8425 Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession 

8426 expressions, valid for long time intervals (Corrigendum), 

8427 Astron.Astrophys. 541, C1 

8428 

8429 This revision: 2021 May 11 

8430 

8431 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8432 Derived, with permission, from the SOFA library. See notes at end of file. 

8433 

8434 """ 

8435 rp = ufunc.ltp(epj) 

8436 return rp 

8437 

8438 

8439def ltpb(epj): 

8440 """ 

8441 Long-term precession matrix, including ICRS frame bias. 

8442 

8443 Parameters 

8444 ---------- 

8445 epj : double array 

8446 

8447 Returns 

8448 ------- 

8449 rpb : double array 

8450 

8451 Notes 

8452 ----- 

8453 Wraps ERFA function ``eraLtpb``. The ERFA documentation is:: 

8454 

8455 - - - - - - - - 

8456 e r a L t p b 

8457 - - - - - - - - 

8458 

8459 Long-term precession matrix, including ICRS frame bias. 

8460 

8461 Given: 

8462 epj double Julian epoch (TT) 

8463 

8464 Returned: 

8465 rpb double[3][3] precession-bias matrix, J2000.0 to date 

8466 

8467 Notes: 

8468 

8469 1) The matrix is in the sense 

8470 

8471 P_date = rpb x P_ICRS, 

8472 

8473 where P_ICRS is a vector in the Geocentric Celestial Reference 

8474 System, and P_date is the vector with respect to the Celestial 

8475 Intermediate Reference System at that date but with nutation 

8476 neglected. 

8477 

8478 2) A first order frame bias formulation is used, of sub- 

8479 microarcsecond accuracy compared with a full 3D rotation. 

8480 

8481 3) The Vondrak et al. (2011, 2012) 400 millennia precession model 

8482 agrees with the IAU 2006 precession at J2000.0 and stays within 

8483 100 microarcseconds during the 20th and 21st centuries. It is 

8484 accurate to a few arcseconds throughout the historical period, 

8485 worsening to a few tenths of a degree at the end of the 

8486 +/- 200,000 year time span. 

8487 

8488 References: 

8489 

8490 Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession 

8491 expressions, valid for long time intervals, Astron.Astrophys. 534, 

8492 A22 

8493 

8494 Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession 

8495 expressions, valid for long time intervals (Corrigendum), 

8496 Astron.Astrophys. 541, C1 

8497 

8498 This revision: 2021 May 11 

8499 

8500 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8501 Derived, with permission, from the SOFA library. See notes at end of file. 

8502 

8503 """ 

8504 rpb = ufunc.ltpb(epj) 

8505 return rpb 

8506 

8507 

8508def ltpecl(epj): 

8509 """ 

8510 Long-term precession of the ecliptic. 

8511 

8512 Parameters 

8513 ---------- 

8514 epj : double array 

8515 

8516 Returns 

8517 ------- 

8518 vec : double array 

8519 

8520 Notes 

8521 ----- 

8522 Wraps ERFA function ``eraLtpecl``. The ERFA documentation is:: 

8523 

8524 - - - - - - - - - - 

8525 e r a L t p e c l 

8526 - - - - - - - - - - 

8527 

8528 Long-term precession of the ecliptic. 

8529 

8530 Given: 

8531 epj double Julian epoch (TT) 

8532 

8533 Returned: 

8534 vec double[3] ecliptic pole unit vector 

8535 

8536 Notes: 

8537 

8538 1) The returned vector is with respect to the J2000.0 mean equator 

8539 and equinox. 

8540 

8541 2) The Vondrak et al. (2011, 2012) 400 millennia precession model 

8542 agrees with the IAU 2006 precession at J2000.0 and stays within 

8543 100 microarcseconds during the 20th and 21st centuries. It is 

8544 accurate to a few arcseconds throughout the historical period, 

8545 worsening to a few tenths of a degree at the end of the 

8546 +/- 200,000 year time span. 

8547 

8548 References: 

8549 

8550 Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession 

8551 expressions, valid for long time intervals, Astron.Astrophys. 534, 

8552 A22 

8553 

8554 Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession 

8555 expressions, valid for long time intervals (Corrigendum), 

8556 Astron.Astrophys. 541, C1 

8557 

8558 This revision: 2021 May 11 

8559 

8560 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8561 Derived, with permission, from the SOFA library. See notes at end of file. 

8562 

8563 """ 

8564 vec = ufunc.ltpecl(epj) 

8565 return vec 

8566 

8567 

8568def ltpequ(epj): 

8569 """ 

8570 Long-term precession of the equator. 

8571 

8572 Parameters 

8573 ---------- 

8574 epj : double array 

8575 

8576 Returns 

8577 ------- 

8578 veq : double array 

8579 

8580 Notes 

8581 ----- 

8582 Wraps ERFA function ``eraLtpequ``. The ERFA documentation is:: 

8583 

8584 - - - - - - - - - - 

8585 e r a L t p e q u 

8586 - - - - - - - - - - 

8587 

8588 Long-term precession of the equator. 

8589 

8590 Given: 

8591 epj double Julian epoch (TT) 

8592 

8593 Returned: 

8594 veq double[3] equator pole unit vector 

8595 

8596 Notes: 

8597 

8598 1) The returned vector is with respect to the J2000.0 mean equator 

8599 and equinox. 

8600 

8601 2) The Vondrak et al. (2011, 2012) 400 millennia precession model 

8602 agrees with the IAU 2006 precession at J2000.0 and stays within 

8603 100 microarcseconds during the 20th and 21st centuries. It is 

8604 accurate to a few arcseconds throughout the historical period, 

8605 worsening to a few tenths of a degree at the end of the 

8606 +/- 200,000 year time span. 

8607 

8608 References: 

8609 

8610 Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession 

8611 expressions, valid for long time intervals, Astron.Astrophys. 534, 

8612 A22 

8613 

8614 Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession 

8615 expressions, valid for long time intervals (Corrigendum), 

8616 Astron.Astrophys. 541, C1 

8617 

8618 This revision: 2021 May 11 

8619 

8620 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8621 Derived, with permission, from the SOFA library. See notes at end of file. 

8622 

8623 """ 

8624 veq = ufunc.ltpequ(epj) 

8625 return veq 

8626 

8627 

8628def num00a(date1, date2): 

8629 """ 

8630 Form the matrix of nutation for a given date, IAU 2000A model. 

8631 

8632 Parameters 

8633 ---------- 

8634 date1 : double array 

8635 date2 : double array 

8636 

8637 Returns 

8638 ------- 

8639 rmatn : double array 

8640 

8641 Notes 

8642 ----- 

8643 Wraps ERFA function ``eraNum00a``. The ERFA documentation is:: 

8644 

8645 - - - - - - - - - - 

8646 e r a N u m 0 0 a 

8647 - - - - - - - - - - 

8648 

8649 Form the matrix of nutation for a given date, IAU 2000A model. 

8650 

8651 Given: 

8652 date1,date2 double TT as a 2-part Julian Date (Note 1) 

8653 

8654 Returned: 

8655 rmatn double[3][3] nutation matrix 

8656 

8657 Notes: 

8658 

8659 1) The TT date date1+date2 is a Julian Date, apportioned in any 

8660 convenient way between the two arguments. For example, 

8661 JD(TT)=2450123.7 could be expressed in any of these ways, 

8662 among others: 

8663 

8664 date1 date2 

8665 

8666 2450123.7 0.0 (JD method) 

8667 2451545.0 -1421.3 (J2000 method) 

8668 2400000.5 50123.2 (MJD method) 

8669 2450123.5 0.2 (date & time method) 

8670 

8671 The JD method is the most natural and convenient to use in 

8672 cases where the loss of several decimal digits of resolution 

8673 is acceptable. The J2000 method is best matched to the way 

8674 the argument is handled internally and will deliver the 

8675 optimum resolution. The MJD method and the date & time methods 

8676 are both good compromises between resolution and convenience. 

8677 

8678 2) The matrix operates in the sense V(true) = rmatn * V(mean), where 

8679 the p-vector V(true) is with respect to the true equatorial triad 

8680 of date and the p-vector V(mean) is with respect to the mean 

8681 equatorial triad of date. 

8682 

8683 3) A faster, but slightly less accurate, result (about 1 mas) can be 

8684 obtained by using instead the eraNum00b function. 

8685 

8686 Called: 

8687 eraPn00a bias/precession/nutation, IAU 2000A 

8688 

8689 Reference: 

8690 

8691 Explanatory Supplement to the Astronomical Almanac, 

8692 P. Kenneth Seidelmann (ed), University Science Books (1992), 

8693 Section 3.222-3 (p114). 

8694 

8695 This revision: 2021 May 11 

8696 

8697 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8698 Derived, with permission, from the SOFA library. See notes at end of file. 

8699 

8700 """ 

8701 rmatn = ufunc.num00a(date1, date2) 

8702 return rmatn 

8703 

8704 

8705def num00b(date1, date2): 

8706 """ 

8707 Form the matrix of nutation for a given date, IAU 2000B model. 

8708 

8709 Parameters 

8710 ---------- 

8711 date1 : double array 

8712 date2 : double array 

8713 

8714 Returns 

8715 ------- 

8716 rmatn : double array 

8717 

8718 Notes 

8719 ----- 

8720 Wraps ERFA function ``eraNum00b``. The ERFA documentation is:: 

8721 

8722 - - - - - - - - - - 

8723 e r a N u m 0 0 b 

8724 - - - - - - - - - - 

8725 

8726 Form the matrix of nutation for a given date, IAU 2000B model. 

8727 

8728 Given: 

8729 date1,date2 double TT as a 2-part Julian Date (Note 1) 

8730 

8731 Returned: 

8732 rmatn double[3][3] nutation matrix 

8733 

8734 Notes: 

8735 

8736 1) The TT date date1+date2 is a Julian Date, apportioned in any 

8737 convenient way between the two arguments. For example, 

8738 JD(TT)=2450123.7 could be expressed in any of these ways, 

8739 among others: 

8740 

8741 date1 date2 

8742 

8743 2450123.7 0.0 (JD method) 

8744 2451545.0 -1421.3 (J2000 method) 

8745 2400000.5 50123.2 (MJD method) 

8746 2450123.5 0.2 (date & time method) 

8747 

8748 The JD method is the most natural and convenient to use in 

8749 cases where the loss of several decimal digits of resolution 

8750 is acceptable. The J2000 method is best matched to the way 

8751 the argument is handled internally and will deliver the 

8752 optimum resolution. The MJD method and the date & time methods 

8753 are both good compromises between resolution and convenience. 

8754 

8755 2) The matrix operates in the sense V(true) = rmatn * V(mean), where 

8756 the p-vector V(true) is with respect to the true equatorial triad 

8757 of date and the p-vector V(mean) is with respect to the mean 

8758 equatorial triad of date. 

8759 

8760 3) The present function is faster, but slightly less accurate (about 

8761 1 mas), than the eraNum00a function. 

8762 

8763 Called: 

8764 eraPn00b bias/precession/nutation, IAU 2000B 

8765 

8766 Reference: 

8767 

8768 Explanatory Supplement to the Astronomical Almanac, 

8769 P. Kenneth Seidelmann (ed), University Science Books (1992), 

8770 Section 3.222-3 (p114). 

8771 

8772 This revision: 2021 May 11 

8773 

8774 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8775 Derived, with permission, from the SOFA library. See notes at end of file. 

8776 

8777 """ 

8778 rmatn = ufunc.num00b(date1, date2) 

8779 return rmatn 

8780 

8781 

8782def num06a(date1, date2): 

8783 """ 

8784 Form the matrix of nutation for a given date, IAU 2006/2000A model. 

8785 

8786 Parameters 

8787 ---------- 

8788 date1 : double array 

8789 date2 : double array 

8790 

8791 Returns 

8792 ------- 

8793 rmatn : double array 

8794 

8795 Notes 

8796 ----- 

8797 Wraps ERFA function ``eraNum06a``. The ERFA documentation is:: 

8798 

8799 - - - - - - - - - - 

8800 e r a N u m 0 6 a 

8801 - - - - - - - - - - 

8802 

8803 Form the matrix of nutation for a given date, IAU 2006/2000A model. 

8804 

8805 Given: 

8806 date1,date2 double TT as a 2-part Julian Date (Note 1) 

8807 

8808 Returned: 

8809 rmatn double[3][3] nutation matrix 

8810 

8811 Notes: 

8812 

8813 1) The TT date date1+date2 is a Julian Date, apportioned in any 

8814 convenient way between the two arguments. For example, 

8815 JD(TT)=2450123.7 could be expressed in any of these ways, 

8816 among others: 

8817 

8818 date1 date2 

8819 

8820 2450123.7 0.0 (JD method) 

8821 2451545.0 -1421.3 (J2000 method) 

8822 2400000.5 50123.2 (MJD method) 

8823 2450123.5 0.2 (date & time method) 

8824 

8825 The JD method is the most natural and convenient to use in 

8826 cases where the loss of several decimal digits of resolution 

8827 is acceptable. The J2000 method is best matched to the way 

8828 the argument is handled internally and will deliver the 

8829 optimum resolution. The MJD method and the date & time methods 

8830 are both good compromises between resolution and convenience. 

8831 

8832 2) The matrix operates in the sense V(true) = rmatn * V(mean), where 

8833 the p-vector V(true) is with respect to the true equatorial triad 

8834 of date and the p-vector V(mean) is with respect to the mean 

8835 equatorial triad of date. 

8836 

8837 Called: 

8838 eraObl06 mean obliquity, IAU 2006 

8839 eraNut06a nutation, IAU 2006/2000A 

8840 eraNumat form nutation matrix 

8841 

8842 Reference: 

8843 

8844 Explanatory Supplement to the Astronomical Almanac, 

8845 P. Kenneth Seidelmann (ed), University Science Books (1992), 

8846 Section 3.222-3 (p114). 

8847 

8848 This revision: 2021 May 11 

8849 

8850 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8851 Derived, with permission, from the SOFA library. See notes at end of file. 

8852 

8853 """ 

8854 rmatn = ufunc.num06a(date1, date2) 

8855 return rmatn 

8856 

8857 

8858def numat(epsa, dpsi, deps): 

8859 """ 

8860 Form the matrix of nutation. 

8861 

8862 Parameters 

8863 ---------- 

8864 epsa : double array 

8865 dpsi : double array 

8866 deps : double array 

8867 

8868 Returns 

8869 ------- 

8870 rmatn : double array 

8871 

8872 Notes 

8873 ----- 

8874 Wraps ERFA function ``eraNumat``. The ERFA documentation is:: 

8875 

8876 - - - - - - - - - 

8877 e r a N u m a t 

8878 - - - - - - - - - 

8879 

8880 Form the matrix of nutation. 

8881 

8882 Given: 

8883 epsa double mean obliquity of date (Note 1) 

8884 dpsi,deps double nutation (Note 2) 

8885 

8886 Returned: 

8887 rmatn double[3][3] nutation matrix (Note 3) 

8888 

8889 Notes: 

8890 

8891 

8892 1) The supplied mean obliquity epsa, must be consistent with the 

8893 precession-nutation models from which dpsi and deps were obtained. 

8894 

8895 2) The caller is responsible for providing the nutation components; 

8896 they are in longitude and obliquity, in radians and are with 

8897 respect to the equinox and ecliptic of date. 

8898 

8899 3) The matrix operates in the sense V(true) = rmatn * V(mean), 

8900 where the p-vector V(true) is with respect to the true 

8901 equatorial triad of date and the p-vector V(mean) is with 

8902 respect to the mean equatorial triad of date. 

8903 

8904 Called: 

8905 eraIr initialize r-matrix to identity 

8906 eraRx rotate around X-axis 

8907 eraRz rotate around Z-axis 

8908 

8909 Reference: 

8910 

8911 Explanatory Supplement to the Astronomical Almanac, 

8912 P. Kenneth Seidelmann (ed), University Science Books (1992), 

8913 Section 3.222-3 (p114). 

8914 

8915 This revision: 2021 May 11 

8916 

8917 Copyright (C) 2013-2021, NumFOCUS Foundation. 

8918 Derived, with permission, from the SOFA library. See notes at end of file. 

8919 

8920 """ 

8921 rmatn = ufunc.numat(epsa, dpsi, deps) 

8922 return rmatn 

8923 

8924 

8925def nut00a(date1, date2): 

8926 """ 

8927 Nutation, IAU 2000A model (MHB2000 luni-solar and planetary nutation 

8928 with free core nutation omitted). 

8929 

8930 Parameters 

8931 ---------- 

8932 date1 : double array 

8933 date2 : double array 

8934 

8935 Returns 

8936 ------- 

8937 dpsi : double array 

8938 deps : double array 

8939 

8940 Notes 

8941 ----- 

8942 Wraps ERFA function ``eraNut00a``. The ERFA documentation is:: 

8943 

8944 - - - - - - - - - - 

8945 e r a N u t 0 0 a 

8946 - - - - - - - - - - 

8947 

8948 Nutation, IAU 2000A model (MHB2000 luni-solar and planetary nutation 

8949 with free core nutation omitted). 

8950 

8951 Given: 

8952 date1,date2 double TT as a 2-part Julian Date (Note 1) 

8953 

8954 Returned: 

8955 dpsi,deps double nutation, luni-solar + planetary (Note 2) 

8956 

8957 Notes: 

8958 

8959 1) The TT date date1+date2 is a Julian Date, apportioned in any 

8960 convenient way between the two arguments. For example, 

8961 JD(TT)=2450123.7 could be expressed in any of these ways, 

8962 among others: 

8963 

8964 date1 date2 

8965 

8966 2450123.7 0.0 (JD method) 

8967 2451545.0 -1421.3 (J2000 method) 

8968 2400000.5 50123.2 (MJD method) 

8969 2450123.5 0.2 (date & time method) 

8970 

8971 The JD method is the most natural and convenient to use in 

8972 cases where the loss of several decimal digits of resolution 

8973 is acceptable. The J2000 method is best matched to the way 

8974 the argument is handled internally and will deliver the 

8975 optimum resolution. The MJD method and the date & time methods 

8976 are both good compromises between resolution and convenience. 

8977 

8978 2) The nutation components in longitude and obliquity are in radians 

8979 and with respect to the equinox and ecliptic of date. The 

8980 obliquity at J2000.0 is assumed to be the Lieske et al. (1977) 

8981 value of 84381.448 arcsec. 

8982 

8983 Both the luni-solar and planetary nutations are included. The 

8984 latter are due to direct planetary nutations and the 

8985 perturbations of the lunar and terrestrial orbits. 

8986 

8987 3) The function computes the MHB2000 nutation series with the 

8988 associated corrections for planetary nutations. It is an 

8989 implementation of the nutation part of the IAU 2000A precession- 

8990 nutation model, formally adopted by the IAU General Assembly in 

8991 2000, namely MHB2000 (Mathews et al. 2002), but with the free 

8992 core nutation (FCN - see Note 4) omitted. 

8993 

8994 4) The full MHB2000 model also contains contributions to the 

8995 nutations in longitude and obliquity due to the free-excitation 

8996 of the free-core-nutation during the period 1979-2000. These FCN 

8997 terms, which are time-dependent and unpredictable, are NOT 

8998 included in the present function and, if required, must be 

8999 independently computed. With the FCN corrections included, the 

9000 present function delivers a pole which is at current epochs 

9001 accurate to a few hundred microarcseconds. The omission of FCN 

9002 introduces further errors of about that size. 

9003 

9004 5) The present function provides classical nutation. The MHB2000 

9005 algorithm, from which it is adapted, deals also with (i) the 

9006 offsets between the GCRS and mean poles and (ii) the adjustments 

9007 in longitude and obliquity due to the changed precession rates. 

9008 These additional functions, namely frame bias and precession 

9009 adjustments, are supported by the ERFA functions eraBi00 and 

9010 eraPr00. 

9011 

9012 6) The MHB2000 algorithm also provides "total" nutations, comprising 

9013 the arithmetic sum of the frame bias, precession adjustments, 

9014 luni-solar nutation and planetary nutation. These total 

9015 nutations can be used in combination with an existing IAU 1976 

9016 precession implementation, such as eraPmat76, to deliver GCRS- 

9017 to-true predictions of sub-mas accuracy at current dates. 

9018 However, there are three shortcomings in the MHB2000 model that 

9019 must be taken into account if more accurate or definitive results 

9020 are required (see Wallace 2002): 

9021 

9022 (i) The MHB2000 total nutations are simply arithmetic sums, 

9023 yet in reality the various components are successive Euler 

9024 rotations. This slight lack of rigor leads to cross terms 

9025 that exceed 1 mas after a century. The rigorous procedure 

9026 is to form the GCRS-to-true rotation matrix by applying the 

9027 bias, precession and nutation in that order. 

9028 

9029 (ii) Although the precession adjustments are stated to be with 

9030 respect to Lieske et al. (1977), the MHB2000 model does 

9031 not specify which set of Euler angles are to be used and 

9032 how the adjustments are to be applied. The most literal 

9033 and straightforward procedure is to adopt the 4-rotation 

9034 epsilon_0, psi_A, omega_A, xi_A option, and to add DPSIPR 

9035 to psi_A and DEPSPR to both omega_A and eps_A. 

9036 

9037 (iii) The MHB2000 model predates the determination by Chapront 

9038 et al. (2002) of a 14.6 mas displacement between the 

9039 J2000.0 mean equinox and the origin of the ICRS frame. It 

9040 should, however, be noted that neglecting this displacement 

9041 when calculating star coordinates does not lead to a 

9042 14.6 mas change in right ascension, only a small second- 

9043 order distortion in the pattern of the precession-nutation 

9044 effect. 

9045 

9046 For these reasons, the ERFA functions do not generate the "total 

9047 nutations" directly, though they can of course easily be 

9048 generated by calling eraBi00, eraPr00 and the present function 

9049 and adding the results. 

9050 

9051 7) The MHB2000 model contains 41 instances where the same frequency 

9052 appears multiple times, of which 38 are duplicates and three are 

9053 triplicates. To keep the present code close to the original MHB 

9054 algorithm, this small inefficiency has not been corrected. 

9055 

9056 Called: 

9057 eraFal03 mean anomaly of the Moon 

9058 eraFaf03 mean argument of the latitude of the Moon 

9059 eraFaom03 mean longitude of the Moon's ascending node 

9060 eraFame03 mean longitude of Mercury 

9061 eraFave03 mean longitude of Venus 

9062 eraFae03 mean longitude of Earth 

9063 eraFama03 mean longitude of Mars 

9064 eraFaju03 mean longitude of Jupiter 

9065 eraFasa03 mean longitude of Saturn 

9066 eraFaur03 mean longitude of Uranus 

9067 eraFapa03 general accumulated precession in longitude 

9068 

9069 References: 

9070 

9071 Chapront, J., Chapront-Touze, M. & Francou, G. 2002, 

9072 Astron.Astrophys. 387, 700 

9073 

9074 Lieske, J.H., Lederle, T., Fricke, W. & Morando, B. 1977, 

9075 Astron.Astrophys. 58, 1-16 

9076 

9077 Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res. 

9078 107, B4. The MHB_2000 code itself was obtained on 9th September 

9079 2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A. 

9080 

9081 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

9082 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

9083 

9084 Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, 

9085 Astron.Astrophys.Supp.Ser. 135, 111 

9086 

9087 Wallace, P.T., "Software for Implementing the IAU 2000 

9088 Resolutions", in IERS Workshop 5.1 (2002) 

9089 

9090 This revision: 2021 May 11 

9091 

9092 Copyright (C) 2013-2021, NumFOCUS Foundation. 

9093 Derived, with permission, from the SOFA library. See notes at end of file. 

9094 

9095 """ 

9096 dpsi, deps = ufunc.nut00a(date1, date2) 

9097 return dpsi, deps 

9098 

9099 

9100def nut00b(date1, date2): 

9101 """ 

9102 Nutation, IAU 2000B model. 

9103 

9104 Parameters 

9105 ---------- 

9106 date1 : double array 

9107 date2 : double array 

9108 

9109 Returns 

9110 ------- 

9111 dpsi : double array 

9112 deps : double array 

9113 

9114 Notes 

9115 ----- 

9116 Wraps ERFA function ``eraNut00b``. The ERFA documentation is:: 

9117 

9118 - - - - - - - - - - 

9119 e r a N u t 0 0 b 

9120 - - - - - - - - - - 

9121 

9122 Nutation, IAU 2000B model. 

9123 

9124 Given: 

9125 date1,date2 double TT as a 2-part Julian Date (Note 1) 

9126 

9127 Returned: 

9128 dpsi,deps double nutation, luni-solar + planetary (Note 2) 

9129 

9130 Notes: 

9131 

9132 1) The TT date date1+date2 is a Julian Date, apportioned in any 

9133 convenient way between the two arguments. For example, 

9134 JD(TT)=2450123.7 could be expressed in any of these ways, 

9135 among others: 

9136 

9137 date1 date2 

9138 

9139 2450123.7 0.0 (JD method) 

9140 2451545.0 -1421.3 (J2000 method) 

9141 2400000.5 50123.2 (MJD method) 

9142 2450123.5 0.2 (date & time method) 

9143 

9144 The JD method is the most natural and convenient to use in 

9145 cases where the loss of several decimal digits of resolution 

9146 is acceptable. The J2000 method is best matched to the way 

9147 the argument is handled internally and will deliver the 

9148 optimum resolution. The MJD method and the date & time methods 

9149 are both good compromises between resolution and convenience. 

9150 

9151 2) The nutation components in longitude and obliquity are in radians 

9152 and with respect to the equinox and ecliptic of date. The 

9153 obliquity at J2000.0 is assumed to be the Lieske et al. (1977) 

9154 value of 84381.448 arcsec. (The errors that result from using 

9155 this function with the IAU 2006 value of 84381.406 arcsec can be 

9156 neglected.) 

9157 

9158 The nutation model consists only of luni-solar terms, but 

9159 includes also a fixed offset which compensates for certain long- 

9160 period planetary terms (Note 7). 

9161 

9162 3) This function is an implementation of the IAU 2000B abridged 

9163 nutation model formally adopted by the IAU General Assembly in 

9164 2000. The function computes the MHB_2000_SHORT luni-solar 

9165 nutation series (Luzum 2001), but without the associated 

9166 corrections for the precession rate adjustments and the offset 

9167 between the GCRS and J2000.0 mean poles. 

9168 

9169 4) The full IAU 2000A (MHB2000) nutation model contains nearly 1400 

9170 terms. The IAU 2000B model (McCarthy & Luzum 2003) contains only 

9171 77 terms, plus additional simplifications, yet still delivers 

9172 results of 1 mas accuracy at present epochs. This combination of 

9173 accuracy and size makes the IAU 2000B abridged nutation model 

9174 suitable for most practical applications. 

9175 

9176 The function delivers a pole accurate to 1 mas from 1900 to 2100 

9177 (usually better than 1 mas, very occasionally just outside 

9178 1 mas). The full IAU 2000A model, which is implemented in the 

9179 function eraNut00a (q.v.), delivers considerably greater accuracy 

9180 at current dates; however, to realize this improved accuracy, 

9181 corrections for the essentially unpredictable free-core-nutation 

9182 (FCN) must also be included. 

9183 

9184 5) The present function provides classical nutation. The 

9185 MHB_2000_SHORT algorithm, from which it is adapted, deals also 

9186 with (i) the offsets between the GCRS and mean poles and (ii) the 

9187 adjustments in longitude and obliquity due to the changed 

9188 precession rates. These additional functions, namely frame bias 

9189 and precession adjustments, are supported by the ERFA functions 

9190 eraBi00 and eraPr00. 

9191 

9192 6) The MHB_2000_SHORT algorithm also provides "total" nutations, 

9193 comprising the arithmetic sum of the frame bias, precession 

9194 adjustments, and nutation (luni-solar + planetary). These total 

9195 nutations can be used in combination with an existing IAU 1976 

9196 precession implementation, such as eraPmat76, to deliver GCRS- 

9197 to-true predictions of mas accuracy at current epochs. However, 

9198 for symmetry with the eraNut00a function (q.v. for the reasons), 

9199 the ERFA functions do not generate the "total nutations" 

9200 directly. Should they be required, they could of course easily 

9201 be generated by calling eraBi00, eraPr00 and the present function 

9202 and adding the results. 

9203 

9204 7) The IAU 2000B model includes "planetary bias" terms that are 

9205 fixed in size but compensate for long-period nutations. The 

9206 amplitudes quoted in McCarthy & Luzum (2003), namely 

9207 Dpsi = -1.5835 mas and Depsilon = +1.6339 mas, are optimized for 

9208 the "total nutations" method described in Note 6. The Luzum 

9209 (2001) values used in this ERFA implementation, namely -0.135 mas 

9210 and +0.388 mas, are optimized for the "rigorous" method, where 

9211 frame bias, precession and nutation are applied separately and in 

9212 that order. During the interval 1995-2050, the ERFA 

9213 implementation delivers a maximum error of 1.001 mas (not 

9214 including FCN). 

9215 

9216 References: 

9217 

9218 Lieske, J.H., Lederle, T., Fricke, W., Morando, B., "Expressions 

9219 for the precession quantities based upon the IAU /1976/ system of 

9220 astronomical constants", Astron.Astrophys. 58, 1-2, 1-16. (1977) 

9221 

9222 Luzum, B., private communication, 2001 (Fortran code 

9223 MHB_2000_SHORT) 

9224 

9225 McCarthy, D.D. & Luzum, B.J., "An abridged model of the 

9226 precession-nutation of the celestial pole", Cel.Mech.Dyn.Astron. 

9227 85, 37-49 (2003) 

9228 

9229 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

9230 Francou, G., Laskar, J., Astron.Astrophys. 282, 663-683 (1994) 

9231 

9232 This revision: 2021 May 11 

9233 

9234 Copyright (C) 2013-2021, NumFOCUS Foundation. 

9235 Derived, with permission, from the SOFA library. See notes at end of file. 

9236 

9237 """ 

9238 dpsi, deps = ufunc.nut00b(date1, date2) 

9239 return dpsi, deps 

9240 

9241 

9242def nut06a(date1, date2): 

9243 """ 

9244 IAU 2000A nutation with adjustments to match the IAU 2006 

9245 precession. 

9246 

9247 Parameters 

9248 ---------- 

9249 date1 : double array 

9250 date2 : double array 

9251 

9252 Returns 

9253 ------- 

9254 dpsi : double array 

9255 deps : double array 

9256 

9257 Notes 

9258 ----- 

9259 Wraps ERFA function ``eraNut06a``. The ERFA documentation is:: 

9260 

9261 - - - - - - - - - - 

9262 e r a N u t 0 6 a 

9263 - - - - - - - - - - 

9264 

9265 IAU 2000A nutation with adjustments to match the IAU 2006 

9266 precession. 

9267 

9268 Given: 

9269 date1,date2 double TT as a 2-part Julian Date (Note 1) 

9270 

9271 Returned: 

9272 dpsi,deps double nutation, luni-solar + planetary (Note 2) 

9273 

9274 Notes: 

9275 

9276 1) The TT date date1+date2 is a Julian Date, apportioned in any 

9277 convenient way between the two arguments. For example, 

9278 JD(TT)=2450123.7 could be expressed in any of these ways, 

9279 among others: 

9280 

9281 date1 date2 

9282 

9283 2450123.7 0.0 (JD method) 

9284 2451545.0 -1421.3 (J2000 method) 

9285 2400000.5 50123.2 (MJD method) 

9286 2450123.5 0.2 (date & time method) 

9287 

9288 The JD method is the most natural and convenient to use in 

9289 cases where the loss of several decimal digits of resolution 

9290 is acceptable. The J2000 method is best matched to the way 

9291 the argument is handled internally and will deliver the 

9292 optimum resolution. The MJD method and the date & time methods 

9293 are both good compromises between resolution and convenience. 

9294 

9295 2) The nutation components in longitude and obliquity are in radians 

9296 and with respect to the mean equinox and ecliptic of date, 

9297 IAU 2006 precession model (Hilton et al. 2006, Capitaine et al. 

9298 2005). 

9299 

9300 3) The function first computes the IAU 2000A nutation, then applies 

9301 adjustments for (i) the consequences of the change in obliquity 

9302 from the IAU 1980 ecliptic to the IAU 2006 ecliptic and (ii) the 

9303 secular variation in the Earth's dynamical form factor J2. 

9304 

9305 4) The present function provides classical nutation, complementing 

9306 the IAU 2000 frame bias and IAU 2006 precession. It delivers a 

9307 pole which is at current epochs accurate to a few tens of 

9308 microarcseconds, apart from the free core nutation. 

9309 

9310 Called: 

9311 eraNut00a nutation, IAU 2000A 

9312 

9313 References: 

9314 

9315 Chapront, J., Chapront-Touze, M. & Francou, G. 2002, 

9316 Astron.Astrophys. 387, 700 

9317 

9318 Lieske, J.H., Lederle, T., Fricke, W. & Morando, B. 1977, 

9319 Astron.Astrophys. 58, 1-16 

9320 

9321 Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res. 

9322 107, B4. The MHB_2000 code itself was obtained on 9th September 

9323 2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A. 

9324 

9325 Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

9326 Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 

9327 

9328 Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, 

9329 Astron.Astrophys.Supp.Ser. 135, 111 

9330 

9331 Wallace, P.T., "Software for Implementing the IAU 2000 

9332 Resolutions", in IERS Workshop 5.1 (2002) 

9333 

9334 This revision: 2021 May 11 

9335 

9336 Copyright (C) 2013-2021, NumFOCUS Foundation. 

9337 Derived, with permission, from the SOFA library. See notes at end of file. 

9338 

9339 """ 

9340 dpsi, deps = ufunc.nut06a(date1, date2) 

9341 return dpsi, deps 

9342 

9343 

9344def nut80(date1, date2): 

9345 """ 

9346 Nutation, IAU 1980 model. 

9347 

9348 Parameters 

9349 ---------- 

9350 date1 : double array 

9351 date2 : double array 

9352 

9353 Returns 

9354 ------- 

9355 dpsi : double array 

9356 deps : double array 

9357 

9358 Notes 

9359 ----- 

9360 Wraps ERFA function ``eraNut80``. The ERFA documentation is:: 

9361 

9362 - - - - - - - - - 

9363 e r a N u t 8 0 

9364 - - - - - - - - - 

9365 

9366 Nutation, IAU 1980 model. 

9367 

9368 Given: 

9369 date1,date2 double TT as a 2-part Julian Date (Note 1) 

9370 

9371 Returned: 

9372 dpsi double nutation in longitude (radians) 

9373 deps double nutation in obliquity (radians) 

9374 

9375 Notes: 

9376 

9377 1) The TT date date1+date2 is a Julian Date, apportioned in any 

9378 convenient way between the two arguments. For example, 

9379 JD(TT)=2450123.7 could be expressed in any of these ways, 

9380 among others: 

9381 

9382 date1 date2 

9383 

9384 2450123.7 0.0 (JD method) 

9385 2451545.0 -1421.3 (J2000 method) 

9386 2400000.5 50123.2 (MJD method) 

9387 2450123.5 0.2 (date & time method) 

9388 

9389 The JD method is the most natural and convenient to use in 

9390 cases where the loss of several decimal digits of resolution 

9391 is acceptable. The J2000 method is best matched to the way 

9392 the argument is handled internally and will deliver the 

9393 optimum resolution. The MJD method and the date & time methods 

9394 are both good compromises between resolution and convenience. 

9395 

9396 2) The nutation components are with respect to the ecliptic of 

9397 date. 

9398 

9399 Called: 

9400 eraAnpm normalize angle into range +/- pi 

9401 

9402 Reference: 

9403 

9404 Explanatory Supplement to the Astronomical Almanac, 

9405 P. Kenneth Seidelmann (ed), University Science Books (1992), 

9406 Section 3.222 (p111). 

9407 

9408 This revision: 2021 May 11 

9409 

9410 Copyright (C) 2013-2021, NumFOCUS Foundation. 

9411 Derived, with permission, from the SOFA library. See notes at end of file. 

9412 

9413 """ 

9414 dpsi, deps = ufunc.nut80(date1, date2) 

9415 return dpsi, deps 

9416 

9417 

9418def nutm80(date1, date2): 

9419 """ 

9420 Form the matrix of nutation for a given date, IAU 1980 model. 

9421 

9422 Parameters 

9423 ---------- 

9424 date1 : double array 

9425 date2 : double array 

9426 

9427 Returns 

9428 ------- 

9429 rmatn : double array 

9430 

9431 Notes 

9432 ----- 

9433 Wraps ERFA function ``eraNutm80``. The ERFA documentation is:: 

9434 

9435 - - - - - - - - - - 

9436 e r a N u t m 8 0 

9437 - - - - - - - - - - 

9438 

9439 Form the matrix of nutation for a given date, IAU 1980 model. 

9440 

9441 Given: 

9442 date1,date2 double TDB date (Note 1) 

9443 

9444 Returned: 

9445 rmatn double[3][3] nutation matrix 

9446 

9447 Notes: 

9448 

9449 1) The TT date date1+date2 is a Julian Date, apportioned in any 

9450 convenient way between the two arguments. For example, 

9451 JD(TT)=2450123.7 could be expressed in any of these ways, 

9452 among others: 

9453 

9454 date1 date2 

9455 

9456 2450123.7 0.0 (JD method) 

9457 2451545.0 -1421.3 (J2000 method) 

9458 2400000.5 50123.2 (MJD method) 

9459 2450123.5 0.2 (date & time method) 

9460 

9461 The JD method is the most natural and convenient to use in 

9462 cases where the loss of several decimal digits of resolution 

9463 is acceptable. The J2000 method is best matched to the way 

9464 the argument is handled internally and will deliver the 

9465 optimum resolution. The MJD method and the date & time methods 

9466 are both good compromises between resolution and convenience. 

9467 

9468 2) The matrix operates in the sense V(true) = rmatn * V(mean), 

9469 where the p-vector V(true) is with respect to the true 

9470 equatorial triad of date and the p-vector V(mean) is with 

9471 respect to the mean equatorial triad of date. 

9472 

9473 Called: 

9474 eraNut80 nutation, IAU 1980 

9475 eraObl80 mean obliquity, IAU 1980 

9476 eraNumat form nutation matrix 

9477 

9478 This revision: 2021 May 11 

9479 

9480 Copyright (C) 2013-2021, NumFOCUS Foundation. 

9481 Derived, with permission, from the SOFA library. See notes at end of file. 

9482 

9483 """ 

9484 rmatn = ufunc.nutm80(date1, date2) 

9485 return rmatn 

9486 

9487 

9488def obl06(date1, date2): 

9489 """ 

9490 Mean obliquity of the ecliptic, IAU 2006 precession model. 

9491 

9492 Parameters 

9493 ---------- 

9494 date1 : double array 

9495 date2 : double array 

9496 

9497 Returns 

9498 ------- 

9499 c_retval : double array 

9500 

9501 Notes 

9502 ----- 

9503 Wraps ERFA function ``eraObl06``. The ERFA documentation is:: 

9504 

9505 - - - - - - - - - 

9506 e r a O b l 0 6 

9507 - - - - - - - - - 

9508 

9509 Mean obliquity of the ecliptic, IAU 2006 precession model. 

9510 

9511 Given: 

9512 date1,date2 double TT as a 2-part Julian Date (Note 1) 

9513 

9514 Returned (function value): 

9515 double obliquity of the ecliptic (radians, Note 2) 

9516 

9517 Notes: 

9518 

9519 1) The TT date date1+date2 is a Julian Date, apportioned in any 

9520 convenient way between the two arguments. For example, 

9521 JD(TT)=2450123.7 could be expressed in any of these ways, 

9522 among others: 

9523 

9524 date1 date2 

9525 

9526 2450123.7 0.0 (JD method) 

9527 2451545.0 -1421.3 (J2000 method) 

9528 2400000.5 50123.2 (MJD method) 

9529 2450123.5 0.2 (date & time method) 

9530 

9531 The JD method is the most natural and convenient to use in 

9532 cases where the loss of several decimal digits of resolution 

9533 is acceptable. The J2000 method is best matched to the way 

9534 the argument is handled internally and will deliver the 

9535 optimum resolution. The MJD method and the date & time methods 

9536 are both good compromises between resolution and convenience. 

9537 

9538 2) The result is the angle between the ecliptic and mean equator of 

9539 date date1+date2. 

9540 

9541 Reference: 

9542 

9543 Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351 

9544 

9545 This revision: 2021 May 11 

9546 

9547 Copyright (C) 2013-2021, NumFOCUS Foundation. 

9548 Derived, with permission, from the SOFA library. See notes at end of file. 

9549 

9550 """ 

9551 c_retval = ufunc.obl06(date1, date2) 

9552 return c_retval 

9553 

9554 

9555def obl80(date1, date2): 

9556 """ 

9557 Mean obliquity of the ecliptic, IAU 1980 model. 

9558 

9559 Parameters 

9560 ---------- 

9561 date1 : double array 

9562 date2 : double array 

9563 

9564 Returns 

9565 ------- 

9566 c_retval : double array 

9567 

9568 Notes 

9569 ----- 

9570 Wraps ERFA function ``eraObl80``. The ERFA documentation is:: 

9571 

9572 - - - - - - - - - 

9573 e r a O b l 8 0 

9574 - - - - - - - - - 

9575 

9576 Mean obliquity of the ecliptic, IAU 1980 model. 

9577 

9578 Given: 

9579 date1,date2 double TT as a 2-part Julian Date (Note 1) 

9580 

9581 Returned (function value): 

9582 double obliquity of the ecliptic (radians, Note 2) 

9583 

9584 Notes: 

9585 

9586 1) The TT date date1+date2 is a Julian Date, apportioned in any 

9587 convenient way between the two arguments. For example, 

9588 JD(TT)=2450123.7 could be expressed in any of these ways, 

9589 among others: 

9590 

9591 date1 date2 

9592 

9593 2450123.7 0.0 (JD method) 

9594 2451545.0 -1421.3 (J2000 method) 

9595 2400000.5 50123.2 (MJD method) 

9596 2450123.5 0.2 (date & time method) 

9597 

9598 The JD method is the most natural and convenient to use in 

9599 cases where the loss of several decimal digits of resolution 

9600 is acceptable. The J2000 method is best matched to the way 

9601 the argument is handled internally and will deliver the 

9602 optimum resolution. The MJD method and the date & time methods 

9603 are both good compromises between resolution and convenience. 

9604 

9605 2) The result is the angle between the ecliptic and mean equator of 

9606 date date1+date2. 

9607 

9608 Reference: 

9609 

9610 Explanatory Supplement to the Astronomical Almanac, 

9611 P. Kenneth Seidelmann (ed), University Science Books (1992), 

9612 Expression 3.222-1 (p114). 

9613 

9614 This revision: 2021 May 11 

9615 

9616 Copyright (C) 2013-2021, NumFOCUS Foundation. 

9617 Derived, with permission, from the SOFA library. See notes at end of file. 

9618 

9619 """ 

9620 c_retval = ufunc.obl80(date1, date2) 

9621 return c_retval 

9622 

9623 

9624def p06e(date1, date2): 

9625 """ 

9626 Precession angles, IAU 2006, equinox based. 

9627 

9628 Parameters 

9629 ---------- 

9630 date1 : double array 

9631 date2 : double array 

9632 

9633 Returns 

9634 ------- 

9635 eps0 : double array 

9636 psia : double array 

9637 oma : double array 

9638 bpa : double array 

9639 bqa : double array 

9640 pia : double array 

9641 bpia : double array 

9642 epsa : double array 

9643 chia : double array 

9644 za : double array 

9645 zetaa : double array 

9646 thetaa : double array 

9647 pa : double array 

9648 gam : double array 

9649 phi : double array 

9650 psi : double array 

9651 

9652 Notes 

9653 ----- 

9654 Wraps ERFA function ``eraP06e``. The ERFA documentation is:: 

9655 

9656 - - - - - - - - 

9657 e r a P 0 6 e 

9658 - - - - - - - - 

9659 

9660 Precession angles, IAU 2006, equinox based. 

9661 

9662 Given: 

9663 date1,date2 double TT as a 2-part Julian Date (Note 1) 

9664 

9665 Returned (see Note 2): 

9666 eps0 double epsilon_0 

9667 psia double psi_A 

9668 oma double omega_A 

9669 bpa double P_A 

9670 bqa double Q_A 

9671 pia double pi_A 

9672 bpia double Pi_A 

9673 epsa double obliquity epsilon_A 

9674 chia double chi_A 

9675 za double z_A 

9676 zetaa double zeta_A 

9677 thetaa double theta_A 

9678 pa double p_A 

9679 gam double F-W angle gamma_J2000 

9680 phi double F-W angle phi_J2000 

9681 psi double F-W angle psi_J2000 

9682 

9683 Notes: 

9684 

9685 1) The TT date date1+date2 is a Julian Date, apportioned in any 

9686 convenient way between the two arguments. For example, 

9687 JD(TT)=2450123.7 could be expressed in any of these ways, 

9688 among others: 

9689 

9690 date1 date2 

9691 

9692 2450123.7 0.0 (JD method) 

9693 2451545.0 -1421.3 (J2000 method) 

9694 2400000.5 50123.2 (MJD method) 

9695 2450123.5 0.2 (date & time method) 

9696 

9697 The JD method is the most natural and convenient to use in 

9698 cases where the loss of several decimal digits of resolution 

9699 is acceptable. The J2000 method is best matched to the way 

9700 the argument is handled internally and will deliver the 

9701 optimum resolution. The MJD method and the date & time methods 

9702 are both good compromises between resolution and convenience. 

9703 

9704 2) This function returns the set of equinox based angles for the 

9705 Capitaine et al. "P03" precession theory, adopted by the IAU in 

9706 2006. The angles are set out in Table 1 of Hilton et al. (2006): 

9707 

9708 eps0 epsilon_0 obliquity at J2000.0 

9709 psia psi_A luni-solar precession 

9710 oma omega_A inclination of equator wrt J2000.0 ecliptic 

9711 bpa P_A ecliptic pole x, J2000.0 ecliptic triad 

9712 bqa Q_A ecliptic pole -y, J2000.0 ecliptic triad 

9713 pia pi_A angle between moving and J2000.0 ecliptics 

9714 bpia Pi_A longitude of ascending node of the ecliptic 

9715 epsa epsilon_A obliquity of the ecliptic 

9716 chia chi_A planetary precession 

9717 za z_A equatorial precession: -3rd 323 Euler angle 

9718 zetaa zeta_A equatorial precession: -1st 323 Euler angle 

9719 thetaa theta_A equatorial precession: 2nd 323 Euler angle 

9720 pa p_A general precession (n.b. see below) 

9721 gam gamma_J2000 J2000.0 RA difference of ecliptic poles 

9722 phi phi_J2000 J2000.0 codeclination of ecliptic pole 

9723 psi psi_J2000 longitude difference of equator poles, J2000.0 

9724 

9725 The returned values are all radians. 

9726 

9727 Note that the t^5 coefficient in the series for p_A from 

9728 Capitaine et al. (2003) is incorrectly signed in Hilton et al. 

9729 (2006). 

9730 

9731 3) Hilton et al. (2006) Table 1 also contains angles that depend on 

9732 models distinct from the P03 precession theory itself, namely the 

9733 IAU 2000A frame bias and nutation. The quoted polynomials are 

9734 used in other ERFA functions: 

9735 

9736 . eraXy06 contains the polynomial parts of the X and Y series. 

9737 

9738 . eraS06 contains the polynomial part of the s+XY/2 series. 

9739 

9740 . eraPfw06 implements the series for the Fukushima-Williams 

9741 angles that are with respect to the GCRS pole (i.e. the variants 

9742 that include frame bias). 

9743 

9744 4) The IAU resolution stipulated that the choice of parameterization 

9745 was left to the user, and so an IAU compliant precession 

9746 implementation can be constructed using various combinations of 

9747 the angles returned by the present function. 

9748 

9749 5) The parameterization used by ERFA is the version of the Fukushima- 

9750 Williams angles that refers directly to the GCRS pole. These 

9751 angles may be calculated by calling the function eraPfw06. ERFA 

9752 also supports the direct computation of the CIP GCRS X,Y by 

9753 series, available by calling eraXy06. 

9754 

9755 6) The agreement between the different parameterizations is at the 

9756 1 microarcsecond level in the present era. 

9757 

9758 7) When constructing a precession formulation that refers to the GCRS 

9759 pole rather than the dynamical pole, it may (depending on the 

9760 choice of angles) be necessary to introduce the frame bias 

9761 explicitly. 

9762 

9763 8) It is permissible to re-use the same variable in the returned 

9764 arguments. The quantities are stored in the stated order. 

9765 

9766 References: 

9767 

9768 Capitaine, N., Wallace, P.T. & Chapront, J., 2003, 

9769 Astron.Astrophys., 412, 567 

9770 

9771 Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351 

9772 

9773 Called: 

9774 eraObl06 mean obliquity, IAU 2006 

9775 

9776 This revision: 2021 May 11 

9777 

9778 Copyright (C) 2013-2021, NumFOCUS Foundation. 

9779 Derived, with permission, from the SOFA library. See notes at end of file. 

9780 

9781 """ 

9782 (eps0, psia, oma, bpa, bqa, pia, bpia, epsa, chia, za, zetaa, thetaa, pa, 

9783 gam, phi, psi) = ufunc.p06e(date1, date2) 

9784 return eps0, psia, oma, bpa, bqa, pia, bpia, epsa, chia, za, zetaa, thetaa, pa, gam, phi, psi 

9785 

9786 

9787def pb06(date1, date2): 

9788 """ 

9789 This function forms three Euler angles which implement general 

9790 precession from epoch J2000.0, using the IAU 2006 model. 

9791 

9792 Parameters 

9793 ---------- 

9794 date1 : double array 

9795 date2 : double array 

9796 

9797 Returns 

9798 ------- 

9799 bzeta : double array 

9800 bz : double array 

9801 btheta : double array 

9802 

9803 Notes 

9804 ----- 

9805 Wraps ERFA function ``eraPb06``. The ERFA documentation is:: 

9806 

9807 - - - - - - - - 

9808 e r a P b 0 6 

9809 - - - - - - - - 

9810 

9811 This function forms three Euler angles which implement general 

9812 precession from epoch J2000.0, using the IAU 2006 model. Frame 

9813 bias (the offset between ICRS and mean J2000.0) is included. 

9814 

9815 Given: 

9816 date1,date2 double TT as a 2-part Julian Date (Note 1) 

9817 

9818 Returned: 

9819 bzeta double 1st rotation: radians cw around z 

9820 bz double 3rd rotation: radians cw around z 

9821 btheta double 2nd rotation: radians ccw around y 

9822 

9823 Notes: 

9824 

9825 1) The TT date date1+date2 is a Julian Date, apportioned in any 

9826 convenient way between the two arguments. For example, 

9827 JD(TT)=2450123.7 could be expressed in any of these ways, 

9828 among others: 

9829 

9830 date1 date2 

9831 

9832 2450123.7 0.0 (JD method) 

9833 2451545.0 -1421.3 (J2000 method) 

9834 2400000.5 50123.2 (MJD method) 

9835 2450123.5 0.2 (date & time method) 

9836 

9837 The JD method is the most natural and convenient to use in 

9838 cases where the loss of several decimal digits of resolution 

9839 is acceptable. The J2000 method is best matched to the way 

9840 the argument is handled internally and will deliver the 

9841 optimum resolution. The MJD method and the date & time methods 

9842 are both good compromises between resolution and convenience. 

9843 

9844 2) The traditional accumulated precession angles zeta_A, z_A, 

9845 theta_A cannot be obtained in the usual way, namely through 

9846 polynomial expressions, because of the frame bias. The latter 

9847 means that two of the angles undergo rapid changes near this 

9848 date. They are instead the results of decomposing the 

9849 precession-bias matrix obtained by using the Fukushima-Williams 

9850 method, which does not suffer from the problem. The 

9851 decomposition returns values which can be used in the 

9852 conventional formulation and which include frame bias. 

9853 

9854 3) The three angles are returned in the conventional order, which 

9855 is not the same as the order of the corresponding Euler 

9856 rotations. The precession-bias matrix is 

9857 R_3(-z) x R_2(+theta) x R_3(-zeta). 

9858 

9859 4) Should zeta_A, z_A, theta_A angles be required that do not 

9860 contain frame bias, they are available by calling the ERFA 

9861 function eraP06e. 

9862 

9863 Called: 

9864 eraPmat06 PB matrix, IAU 2006 

9865 eraRz rotate around Z-axis 

9866 

9867 This revision: 2021 May 11 

9868 

9869 Copyright (C) 2013-2021, NumFOCUS Foundation. 

9870 Derived, with permission, from the SOFA library. See notes at end of file. 

9871 

9872 """ 

9873 bzeta, bz, btheta = ufunc.pb06(date1, date2) 

9874 return bzeta, bz, btheta 

9875 

9876 

9877def pfw06(date1, date2): 

9878 """ 

9879 Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation). 

9880 

9881 Parameters 

9882 ---------- 

9883 date1 : double array 

9884 date2 : double array 

9885 

9886 Returns 

9887 ------- 

9888 gamb : double array 

9889 phib : double array 

9890 psib : double array 

9891 epsa : double array 

9892 

9893 Notes 

9894 ----- 

9895 Wraps ERFA function ``eraPfw06``. The ERFA documentation is:: 

9896 

9897 - - - - - - - - - 

9898 e r a P f w 0 6 

9899 - - - - - - - - - 

9900 

9901 Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation). 

9902 

9903 Given: 

9904 date1,date2 double TT as a 2-part Julian Date (Note 1) 

9905 

9906 Returned: 

9907 gamb double F-W angle gamma_bar (radians) 

9908 phib double F-W angle phi_bar (radians) 

9909 psib double F-W angle psi_bar (radians) 

9910 epsa double F-W angle epsilon_A (radians) 

9911 

9912 Notes: 

9913 

9914 1) The TT date date1+date2 is a Julian Date, apportioned in any 

9915 convenient way between the two arguments. For example, 

9916 JD(TT)=2450123.7 could be expressed in any of these ways, 

9917 among others: 

9918 

9919 date1 date2 

9920 

9921 2450123.7 0.0 (JD method) 

9922 2451545.0 -1421.3 (J2000 method) 

9923 2400000.5 50123.2 (MJD method) 

9924 2450123.5 0.2 (date & time method) 

9925 

9926 The JD method is the most natural and convenient to use in 

9927 cases where the loss of several decimal digits of resolution 

9928 is acceptable. The J2000 method is best matched to the way 

9929 the argument is handled internally and will deliver the 

9930 optimum resolution. The MJD method and the date & time methods 

9931 are both good compromises between resolution and convenience. 

9932 

9933 2) Naming the following points: 

9934 

9935 e = J2000.0 ecliptic pole, 

9936 p = GCRS pole, 

9937 E = mean ecliptic pole of date, 

9938 and P = mean pole of date, 

9939 

9940 the four Fukushima-Williams angles are as follows: 

9941 

9942 gamb = gamma_bar = epE 

9943 phib = phi_bar = pE 

9944 psib = psi_bar = pEP 

9945 epsa = epsilon_A = EP 

9946 

9947 3) The matrix representing the combined effects of frame bias and 

9948 precession is: 

9949 

9950 PxB = R_1(-epsa).R_3(-psib).R_1(phib).R_3(gamb) 

9951 

9952 4) The matrix representing the combined effects of frame bias, 

9953 precession and nutation is simply: 

9954 

9955 NxPxB = R_1(-epsa-dE).R_3(-psib-dP).R_1(phib).R_3(gamb) 

9956 

9957 where dP and dE are the nutation components with respect to the 

9958 ecliptic of date. 

9959 

9960 Reference: 

9961 

9962 Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351 

9963 

9964 Called: 

9965 eraObl06 mean obliquity, IAU 2006 

9966 

9967 This revision: 2021 May 11 

9968 

9969 Copyright (C) 2013-2021, NumFOCUS Foundation. 

9970 Derived, with permission, from the SOFA library. See notes at end of file. 

9971 

9972 """ 

9973 gamb, phib, psib, epsa = ufunc.pfw06(date1, date2) 

9974 return gamb, phib, psib, epsa 

9975 

9976 

9977def pmat00(date1, date2): 

9978 """ 

9979 Precession matrix (including frame bias) from GCRS to a specified 

9980 date, IAU 2000 model. 

9981 

9982 Parameters 

9983 ---------- 

9984 date1 : double array 

9985 date2 : double array 

9986 

9987 Returns 

9988 ------- 

9989 rbp : double array 

9990 

9991 Notes 

9992 ----- 

9993 Wraps ERFA function ``eraPmat00``. The ERFA documentation is:: 

9994 

9995 - - - - - - - - - - 

9996 e r a P m a t 0 0 

9997 - - - - - - - - - - 

9998 

9999 Precession matrix (including frame bias) from GCRS to a specified 

10000 date, IAU 2000 model. 

10001 

10002 Given: 

10003 date1,date2 double TT as a 2-part Julian Date (Note 1) 

10004 

10005 Returned: 

10006 rbp double[3][3] bias-precession matrix (Note 2) 

10007 

10008 Notes: 

10009 

10010 1) The TT date date1+date2 is a Julian Date, apportioned in any 

10011 convenient way between the two arguments. For example, 

10012 JD(TT)=2450123.7 could be expressed in any of these ways, 

10013 among others: 

10014 

10015 date1 date2 

10016 

10017 2450123.7 0.0 (JD method) 

10018 2451545.0 -1421.3 (J2000 method) 

10019 2400000.5 50123.2 (MJD method) 

10020 2450123.5 0.2 (date & time method) 

10021 

10022 The JD method is the most natural and convenient to use in 

10023 cases where the loss of several decimal digits of resolution 

10024 is acceptable. The J2000 method is best matched to the way 

10025 the argument is handled internally and will deliver the 

10026 optimum resolution. The MJD method and the date & time methods 

10027 are both good compromises between resolution and convenience. 

10028 

10029 2) The matrix operates in the sense V(date) = rbp * V(GCRS), where 

10030 the p-vector V(GCRS) is with respect to the Geocentric Celestial 

10031 Reference System (IAU, 2000) and the p-vector V(date) is with 

10032 respect to the mean equatorial triad of the given date. 

10033 

10034 Called: 

10035 eraBp00 frame bias and precession matrices, IAU 2000 

10036 

10037 Reference: 

10038 

10039 IAU: Trans. International Astronomical Union, Vol. XXIVB; Proc. 

10040 24th General Assembly, Manchester, UK. Resolutions B1.3, B1.6. 

10041 (2000) 

10042 

10043 This revision: 2021 May 11 

10044 

10045 Copyright (C) 2013-2021, NumFOCUS Foundation. 

10046 Derived, with permission, from the SOFA library. See notes at end of file. 

10047 

10048 """ 

10049 rbp = ufunc.pmat00(date1, date2) 

10050 return rbp 

10051 

10052 

10053def pmat06(date1, date2): 

10054 """ 

10055 Precession matrix (including frame bias) from GCRS to a specified 

10056 date, IAU 2006 model. 

10057 

10058 Parameters 

10059 ---------- 

10060 date1 : double array 

10061 date2 : double array 

10062 

10063 Returns 

10064 ------- 

10065 rbp : double array 

10066 

10067 Notes 

10068 ----- 

10069 Wraps ERFA function ``eraPmat06``. The ERFA documentation is:: 

10070 

10071 - - - - - - - - - - 

10072 e r a P m a t 0 6 

10073 - - - - - - - - - - 

10074 

10075 Precession matrix (including frame bias) from GCRS to a specified 

10076 date, IAU 2006 model. 

10077 

10078 Given: 

10079 date1,date2 double TT as a 2-part Julian Date (Note 1) 

10080 

10081 Returned: 

10082 rbp double[3][3] bias-precession matrix (Note 2) 

10083 

10084 Notes: 

10085 

10086 1) The TT date date1+date2 is a Julian Date, apportioned in any 

10087 convenient way between the two arguments. For example, 

10088 JD(TT)=2450123.7 could be expressed in any of these ways, 

10089 among others: 

10090 

10091 date1 date2 

10092 

10093 2450123.7 0.0 (JD method) 

10094 2451545.0 -1421.3 (J2000 method) 

10095 2400000.5 50123.2 (MJD method) 

10096 2450123.5 0.2 (date & time method) 

10097 

10098 The JD method is the most natural and convenient to use in 

10099 cases where the loss of several decimal digits of resolution 

10100 is acceptable. The J2000 method is best matched to the way 

10101 the argument is handled internally and will deliver the 

10102 optimum resolution. The MJD method and the date & time methods 

10103 are both good compromises between resolution and convenience. 

10104 

10105 2) The matrix operates in the sense V(date) = rbp * V(GCRS), where 

10106 the p-vector V(GCRS) is with respect to the Geocentric Celestial 

10107 Reference System (IAU, 2000) and the p-vector V(date) is with 

10108 respect to the mean equatorial triad of the given date. 

10109 

10110 Called: 

10111 eraPfw06 bias-precession F-W angles, IAU 2006 

10112 eraFw2m F-W angles to r-matrix 

10113 

10114 References: 

10115 

10116 Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 

10117 

10118 IAU: Trans. International Astronomical Union, Vol. XXIVB; Proc. 

10119 24th General Assembly, Manchester, UK. Resolutions B1.3, B1.6. 

10120 (2000) 

10121 

10122 Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 

10123 

10124 This revision: 2021 May 11 

10125 

10126 Copyright (C) 2013-2021, NumFOCUS Foundation. 

10127 Derived, with permission, from the SOFA library. See notes at end of file. 

10128 

10129 """ 

10130 rbp = ufunc.pmat06(date1, date2) 

10131 return rbp 

10132 

10133 

10134def pmat76(date1, date2): 

10135 """ 

10136 Precession matrix from J2000.0 to a specified date, IAU 1976 model. 

10137 

10138 Parameters 

10139 ---------- 

10140 date1 : double array 

10141 date2 : double array 

10142 

10143 Returns 

10144 ------- 

10145 rmatp : double array 

10146 

10147 Notes 

10148 ----- 

10149 Wraps ERFA function ``eraPmat76``. The ERFA documentation is:: 

10150 

10151 - - - - - - - - - - 

10152 e r a P m a t 7 6 

10153 - - - - - - - - - - 

10154 

10155 Precession matrix from J2000.0 to a specified date, IAU 1976 model. 

10156 

10157 Given: 

10158 date1,date2 double ending date, TT (Note 1) 

10159 

10160 Returned: 

10161 rmatp double[3][3] precession matrix, J2000.0 -> date1+date2 

10162 

10163 Notes: 

10164 

10165 1) The TT date date1+date2 is a Julian Date, apportioned in any 

10166 convenient way between the two arguments. For example, 

10167 JD(TT)=2450123.7 could be expressed in any of these ways, 

10168 among others: 

10169 

10170 date1 date2 

10171 

10172 2450123.7 0.0 (JD method) 

10173 2451545.0 -1421.3 (J2000 method) 

10174 2400000.5 50123.2 (MJD method) 

10175 2450123.5 0.2 (date & time method) 

10176 

10177 The JD method is the most natural and convenient to use in 

10178 cases where the loss of several decimal digits of resolution 

10179 is acceptable. The J2000 method is best matched to the way 

10180 the argument is handled internally and will deliver the 

10181 optimum resolution. The MJD method and the date & time methods 

10182 are both good compromises between resolution and convenience. 

10183 

10184 2) The matrix operates in the sense V(date) = RMATP * V(J2000), 

10185 where the p-vector V(J2000) is with respect to the mean 

10186 equatorial triad of epoch J2000.0 and the p-vector V(date) 

10187 is with respect to the mean equatorial triad of the given 

10188 date. 

10189 

10190 3) Though the matrix method itself is rigorous, the precession 

10191 angles are expressed through canonical polynomials which are 

10192 valid only for a limited time span. In addition, the IAU 1976 

10193 precession rate is known to be imperfect. The absolute accuracy 

10194 of the present formulation is better than 0.1 arcsec from 

10195 1960AD to 2040AD, better than 1 arcsec from 1640AD to 2360AD, 

10196 and remains below 3 arcsec for the whole of the period 

10197 500BC to 3000AD. The errors exceed 10 arcsec outside the 

10198 range 1200BC to 3900AD, exceed 100 arcsec outside 4200BC to 

10199 5600AD and exceed 1000 arcsec outside 6800BC to 8200AD. 

10200 

10201 Called: 

10202 eraPrec76 accumulated precession angles, IAU 1976 

10203 eraIr initialize r-matrix to identity 

10204 eraRz rotate around Z-axis 

10205 eraRy rotate around Y-axis 

10206 eraCr copy r-matrix 

10207 

10208 References: 

10209 

10210 Lieske, J.H., 1979, Astron.Astrophys. 73, 282. 

10211 equations (6) & (7), p283. 

10212 

10213 Kaplan,G.H., 1981. USNO circular no. 163, pA2. 

10214 

10215 This revision: 2021 May 11 

10216 

10217 Copyright (C) 2013-2021, NumFOCUS Foundation. 

10218 Derived, with permission, from the SOFA library. See notes at end of file. 

10219 

10220 """ 

10221 rmatp = ufunc.pmat76(date1, date2) 

10222 return rmatp 

10223 

10224 

10225def pn00(date1, date2, dpsi, deps): 

10226 """ 

10227 Precession-nutation, IAU 2000 model: a multi-purpose function, 

10228 supporting classical (equinox-based) use directly and CIO-based 

10229 use indirectly. 

10230 

10231 Parameters 

10232 ---------- 

10233 date1 : double array 

10234 date2 : double array 

10235 dpsi : double array 

10236 deps : double array 

10237 

10238 Returns 

10239 ------- 

10240 epsa : double array 

10241 rb : double array 

10242 rp : double array 

10243 rbp : double array 

10244 rn : double array 

10245 rbpn : double array 

10246 

10247 Notes 

10248 ----- 

10249 Wraps ERFA function ``eraPn00``. The ERFA documentation is:: 

10250 

10251 - - - - - - - - 

10252 e r a P n 0 0 

10253 - - - - - - - - 

10254 

10255 Precession-nutation, IAU 2000 model: a multi-purpose function, 

10256 supporting classical (equinox-based) use directly and CIO-based 

10257 use indirectly. 

10258 

10259 Given: 

10260 date1,date2 double TT as a 2-part Julian Date (Note 1) 

10261 dpsi,deps double nutation (Note 2) 

10262 

10263 Returned: 

10264 epsa double mean obliquity (Note 3) 

10265 rb double[3][3] frame bias matrix (Note 4) 

10266 rp double[3][3] precession matrix (Note 5) 

10267 rbp double[3][3] bias-precession matrix (Note 6) 

10268 rn double[3][3] nutation matrix (Note 7) 

10269 rbpn double[3][3] GCRS-to-true matrix (Note 8) 

10270 

10271 Notes: 

10272 

10273 1) The TT date date1+date2 is a Julian Date, apportioned in any 

10274 convenient way between the two arguments. For example, 

10275 JD(TT)=2450123.7 could be expressed in any of these ways, 

10276 among others: 

10277 

10278 date1 date2 

10279 

10280 2450123.7 0.0 (JD method) 

10281 2451545.0 -1421.3 (J2000 method) 

10282 2400000.5 50123.2 (MJD method) 

10283 2450123.5 0.2 (date & time method) 

10284 

10285 The JD method is the most natural and convenient to use in 

10286 cases where the loss of several decimal digits of resolution 

10287 is acceptable. The J2000 method is best matched to the way 

10288 the argument is handled internally and will deliver the 

10289 optimum resolution. The MJD method and the date & time methods 

10290 are both good compromises between resolution and convenience. 

10291 

10292 2) The caller is responsible for providing the nutation components; 

10293 they are in longitude and obliquity, in radians and are with 

10294 respect to the equinox and ecliptic of date. For high-accuracy 

10295 applications, free core nutation should be included as well as 

10296 any other relevant corrections to the position of the CIP. 

10297 

10298 3) The returned mean obliquity is consistent with the IAU 2000 

10299 precession-nutation models. 

10300 

10301 4) The matrix rb transforms vectors from GCRS to J2000.0 mean 

10302 equator and equinox by applying frame bias. 

10303 

10304 5) The matrix rp transforms vectors from J2000.0 mean equator and 

10305 equinox to mean equator and equinox of date by applying 

10306 precession. 

10307 

10308 6) The matrix rbp transforms vectors from GCRS to mean equator and 

10309 equinox of date by applying frame bias then precession. It is 

10310 the product rp x rb. 

10311 

10312 7) The matrix rn transforms vectors from mean equator and equinox of 

10313 date to true equator and equinox of date by applying the nutation 

10314 (luni-solar + planetary). 

10315 

10316 8) The matrix rbpn transforms vectors from GCRS to true equator and 

10317 equinox of date. It is the product rn x rbp, applying frame 

10318 bias, precession and nutation in that order. 

10319 

10320 9) It is permissible to re-use the same array in the returned 

10321 arguments. The arrays are filled in the order given. 

10322 

10323 Called: 

10324 eraPr00 IAU 2000 precession adjustments 

10325 eraObl80 mean obliquity, IAU 1980 

10326 eraBp00 frame bias and precession matrices, IAU 2000 

10327 eraCr copy r-matrix 

10328 eraNumat form nutation matrix 

10329 eraRxr product of two r-matrices 

10330 

10331 Reference: 

10332 

10333 Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., 

10334 "Expressions for the Celestial Intermediate Pole and Celestial 

10335 Ephemeris Origin consistent with the IAU 2000A precession- 

10336 nutation model", Astron.Astrophys. 400, 1145-1154 (2003) 

10337 

10338 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

10339 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

10340 

10341 This revision: 2021 May 11 

10342 

10343 Copyright (C) 2013-2021, NumFOCUS Foundation. 

10344 Derived, with permission, from the SOFA library. See notes at end of file. 

10345 

10346 """ 

10347 epsa, rb, rp, rbp, rn, rbpn = ufunc.pn00(date1, date2, dpsi, deps) 

10348 return epsa, rb, rp, rbp, rn, rbpn 

10349 

10350 

10351def pn00a(date1, date2): 

10352 """ 

10353 Precession-nutation, IAU 2000A model: a multi-purpose function, 

10354 supporting classical (equinox-based) use directly and CIO-based 

10355 use indirectly. 

10356 

10357 Parameters 

10358 ---------- 

10359 date1 : double array 

10360 date2 : double array 

10361 

10362 Returns 

10363 ------- 

10364 dpsi : double array 

10365 deps : double array 

10366 epsa : double array 

10367 rb : double array 

10368 rp : double array 

10369 rbp : double array 

10370 rn : double array 

10371 rbpn : double array 

10372 

10373 Notes 

10374 ----- 

10375 Wraps ERFA function ``eraPn00a``. The ERFA documentation is:: 

10376 

10377 - - - - - - - - - 

10378 e r a P n 0 0 a 

10379 - - - - - - - - - 

10380 

10381 Precession-nutation, IAU 2000A model: a multi-purpose function, 

10382 supporting classical (equinox-based) use directly and CIO-based 

10383 use indirectly. 

10384 

10385 Given: 

10386 date1,date2 double TT as a 2-part Julian Date (Note 1) 

10387 

10388 Returned: 

10389 dpsi,deps double nutation (Note 2) 

10390 epsa double mean obliquity (Note 3) 

10391 rb double[3][3] frame bias matrix (Note 4) 

10392 rp double[3][3] precession matrix (Note 5) 

10393 rbp double[3][3] bias-precession matrix (Note 6) 

10394 rn double[3][3] nutation matrix (Note 7) 

10395 rbpn double[3][3] GCRS-to-true matrix (Notes 8,9) 

10396 

10397 Notes: 

10398 

10399 1) The TT date date1+date2 is a Julian Date, apportioned in any 

10400 convenient way between the two arguments. For example, 

10401 JD(TT)=2450123.7 could be expressed in any of these ways, 

10402 among others: 

10403 

10404 date1 date2 

10405 

10406 2450123.7 0.0 (JD method) 

10407 2451545.0 -1421.3 (J2000 method) 

10408 2400000.5 50123.2 (MJD method) 

10409 2450123.5 0.2 (date & time method) 

10410 

10411 The JD method is the most natural and convenient to use in 

10412 cases where the loss of several decimal digits of resolution 

10413 is acceptable. The J2000 method is best matched to the way 

10414 the argument is handled internally and will deliver the 

10415 optimum resolution. The MJD method and the date & time methods 

10416 are both good compromises between resolution and convenience. 

10417 

10418 2) The nutation components (luni-solar + planetary, IAU 2000A) in 

10419 longitude and obliquity are in radians and with respect to the 

10420 equinox and ecliptic of date. Free core nutation is omitted; 

10421 for the utmost accuracy, use the eraPn00 function, where the 

10422 nutation components are caller-specified. For faster but 

10423 slightly less accurate results, use the eraPn00b function. 

10424 

10425 3) The mean obliquity is consistent with the IAU 2000 precession. 

10426 

10427 4) The matrix rb transforms vectors from GCRS to J2000.0 mean 

10428 equator and equinox by applying frame bias. 

10429 

10430 5) The matrix rp transforms vectors from J2000.0 mean equator and 

10431 equinox to mean equator and equinox of date by applying 

10432 precession. 

10433 

10434 6) The matrix rbp transforms vectors from GCRS to mean equator and 

10435 equinox of date by applying frame bias then precession. It is 

10436 the product rp x rb. 

10437 

10438 7) The matrix rn transforms vectors from mean equator and equinox 

10439 of date to true equator and equinox of date by applying the 

10440 nutation (luni-solar + planetary). 

10441 

10442 8) The matrix rbpn transforms vectors from GCRS to true equator and 

10443 equinox of date. It is the product rn x rbp, applying frame 

10444 bias, precession and nutation in that order. 

10445 

10446 9) The X,Y,Z coordinates of the IAU 2000A Celestial Intermediate 

10447 Pole are elements (3,1-3) of the GCRS-to-true matrix, 

10448 i.e. rbpn[2][0-2]. 

10449 

10450 10) It is permissible to re-use the same array in the returned 

10451 arguments. The arrays are filled in the stated order. 

10452 

10453 Called: 

10454 eraNut00a nutation, IAU 2000A 

10455 eraPn00 bias/precession/nutation results, IAU 2000 

10456 

10457 Reference: 

10458 

10459 Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., 

10460 "Expressions for the Celestial Intermediate Pole and Celestial 

10461 Ephemeris Origin consistent with the IAU 2000A precession- 

10462 nutation model", Astron.Astrophys. 400, 1145-1154 (2003) 

10463 

10464 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

10465 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

10466 

10467 This revision: 2021 May 11 

10468 

10469 Copyright (C) 2013-2021, NumFOCUS Foundation. 

10470 Derived, with permission, from the SOFA library. See notes at end of file. 

10471 

10472 """ 

10473 dpsi, deps, epsa, rb, rp, rbp, rn, rbpn = ufunc.pn00a(date1, date2) 

10474 return dpsi, deps, epsa, rb, rp, rbp, rn, rbpn 

10475 

10476 

10477def pn00b(date1, date2): 

10478 """ 

10479 Precession-nutation, IAU 2000B model: a multi-purpose function, 

10480 supporting classical (equinox-based) use directly and CIO-based 

10481 use indirectly. 

10482 

10483 Parameters 

10484 ---------- 

10485 date1 : double array 

10486 date2 : double array 

10487 

10488 Returns 

10489 ------- 

10490 dpsi : double array 

10491 deps : double array 

10492 epsa : double array 

10493 rb : double array 

10494 rp : double array 

10495 rbp : double array 

10496 rn : double array 

10497 rbpn : double array 

10498 

10499 Notes 

10500 ----- 

10501 Wraps ERFA function ``eraPn00b``. The ERFA documentation is:: 

10502 

10503 - - - - - - - - - 

10504 e r a P n 0 0 b 

10505 - - - - - - - - - 

10506 

10507 Precession-nutation, IAU 2000B model: a multi-purpose function, 

10508 supporting classical (equinox-based) use directly and CIO-based 

10509 use indirectly. 

10510 

10511 Given: 

10512 date1,date2 double TT as a 2-part Julian Date (Note 1) 

10513 

10514 Returned: 

10515 dpsi,deps double nutation (Note 2) 

10516 epsa double mean obliquity (Note 3) 

10517 rb double[3][3] frame bias matrix (Note 4) 

10518 rp double[3][3] precession matrix (Note 5) 

10519 rbp double[3][3] bias-precession matrix (Note 6) 

10520 rn double[3][3] nutation matrix (Note 7) 

10521 rbpn double[3][3] GCRS-to-true matrix (Notes 8,9) 

10522 

10523 Notes: 

10524 

10525 1) The TT date date1+date2 is a Julian Date, apportioned in any 

10526 convenient way between the two arguments. For example, 

10527 JD(TT)=2450123.7 could be expressed in any of these ways, 

10528 among others: 

10529 

10530 date1 date2 

10531 

10532 2450123.7 0.0 (JD method) 

10533 2451545.0 -1421.3 (J2000 method) 

10534 2400000.5 50123.2 (MJD method) 

10535 2450123.5 0.2 (date & time method) 

10536 

10537 The JD method is the most natural and convenient to use in 

10538 cases where the loss of several decimal digits of resolution 

10539 is acceptable. The J2000 method is best matched to the way 

10540 the argument is handled internally and will deliver the 

10541 optimum resolution. The MJD method and the date & time methods 

10542 are both good compromises between resolution and convenience. 

10543 

10544 2) The nutation components (luni-solar + planetary, IAU 2000B) in 

10545 longitude and obliquity are in radians and with respect to the 

10546 equinox and ecliptic of date. For more accurate results, but 

10547 at the cost of increased computation, use the eraPn00a function. 

10548 For the utmost accuracy, use the eraPn00 function, where the 

10549 nutation components are caller-specified. 

10550 

10551 3) The mean obliquity is consistent with the IAU 2000 precession. 

10552 

10553 4) The matrix rb transforms vectors from GCRS to J2000.0 mean 

10554 equator and equinox by applying frame bias. 

10555 

10556 5) The matrix rp transforms vectors from J2000.0 mean equator and 

10557 equinox to mean equator and equinox of date by applying 

10558 precession. 

10559 

10560 6) The matrix rbp transforms vectors from GCRS to mean equator and 

10561 equinox of date by applying frame bias then precession. It is 

10562 the product rp x rb. 

10563 

10564 7) The matrix rn transforms vectors from mean equator and equinox 

10565 of date to true equator and equinox of date by applying the 

10566 nutation (luni-solar + planetary). 

10567 

10568 8) The matrix rbpn transforms vectors from GCRS to true equator and 

10569 equinox of date. It is the product rn x rbp, applying frame 

10570 bias, precession and nutation in that order. 

10571 

10572 9) The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate 

10573 Pole are elements (3,1-3) of the GCRS-to-true matrix, 

10574 i.e. rbpn[2][0-2]. 

10575 

10576 10) It is permissible to re-use the same array in the returned 

10577 arguments. The arrays are filled in the stated order. 

10578 

10579 Called: 

10580 eraNut00b nutation, IAU 2000B 

10581 eraPn00 bias/precession/nutation results, IAU 2000 

10582 

10583 Reference: 

10584 

10585 Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., 

10586 "Expressions for the Celestial Intermediate Pole and Celestial 

10587 Ephemeris Origin consistent with the IAU 2000A precession- 

10588 nutation model", Astron.Astrophys. 400, 1145-1154 (2003). 

10589 

10590 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

10591 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

10592 

10593 This revision: 2021 May 11 

10594 

10595 Copyright (C) 2013-2021, NumFOCUS Foundation. 

10596 Derived, with permission, from the SOFA library. See notes at end of file. 

10597 

10598 """ 

10599 dpsi, deps, epsa, rb, rp, rbp, rn, rbpn = ufunc.pn00b(date1, date2) 

10600 return dpsi, deps, epsa, rb, rp, rbp, rn, rbpn 

10601 

10602 

10603def pn06(date1, date2, dpsi, deps): 

10604 """ 

10605 Precession-nutation, IAU 2006 model: a multi-purpose function, 

10606 supporting classical (equinox-based) use directly and CIO-based use 

10607 indirectly. 

10608 

10609 Parameters 

10610 ---------- 

10611 date1 : double array 

10612 date2 : double array 

10613 dpsi : double array 

10614 deps : double array 

10615 

10616 Returns 

10617 ------- 

10618 epsa : double array 

10619 rb : double array 

10620 rp : double array 

10621 rbp : double array 

10622 rn : double array 

10623 rbpn : double array 

10624 

10625 Notes 

10626 ----- 

10627 Wraps ERFA function ``eraPn06``. The ERFA documentation is:: 

10628 

10629 - - - - - - - - 

10630 e r a P n 0 6 

10631 - - - - - - - - 

10632 

10633 Precession-nutation, IAU 2006 model: a multi-purpose function, 

10634 supporting classical (equinox-based) use directly and CIO-based use 

10635 indirectly. 

10636 

10637 Given: 

10638 date1,date2 double TT as a 2-part Julian Date (Note 1) 

10639 dpsi,deps double nutation (Note 2) 

10640 

10641 Returned: 

10642 epsa double mean obliquity (Note 3) 

10643 rb double[3][3] frame bias matrix (Note 4) 

10644 rp double[3][3] precession matrix (Note 5) 

10645 rbp double[3][3] bias-precession matrix (Note 6) 

10646 rn double[3][3] nutation matrix (Note 7) 

10647 rbpn double[3][3] GCRS-to-true matrix (Notes 8,9) 

10648 

10649 Notes: 

10650 

10651 1) The TT date date1+date2 is a Julian Date, apportioned in any 

10652 convenient way between the two arguments. For example, 

10653 JD(TT)=2450123.7 could be expressed in any of these ways, 

10654 among others: 

10655 

10656 date1 date2 

10657 

10658 2450123.7 0.0 (JD method) 

10659 2451545.0 -1421.3 (J2000 method) 

10660 2400000.5 50123.2 (MJD method) 

10661 2450123.5 0.2 (date & time method) 

10662 

10663 The JD method is the most natural and convenient to use in 

10664 cases where the loss of several decimal digits of resolution 

10665 is acceptable. The J2000 method is best matched to the way 

10666 the argument is handled internally and will deliver the 

10667 optimum resolution. The MJD method and the date & time methods 

10668 are both good compromises between resolution and convenience. 

10669 

10670 2) The caller is responsible for providing the nutation components; 

10671 they are in longitude and obliquity, in radians and are with 

10672 respect to the equinox and ecliptic of date. For high-accuracy 

10673 applications, free core nutation should be included as well as 

10674 any other relevant corrections to the position of the CIP. 

10675 

10676 3) The returned mean obliquity is consistent with the IAU 2006 

10677 precession. 

10678 

10679 4) The matrix rb transforms vectors from GCRS to J2000.0 mean 

10680 equator and equinox by applying frame bias. 

10681 

10682 5) The matrix rp transforms vectors from J2000.0 mean equator and 

10683 equinox to mean equator and equinox of date by applying 

10684 precession. 

10685 

10686 6) The matrix rbp transforms vectors from GCRS to mean equator and 

10687 equinox of date by applying frame bias then precession. It is 

10688 the product rp x rb. 

10689 

10690 7) The matrix rn transforms vectors from mean equator and equinox 

10691 of date to true equator and equinox of date by applying the 

10692 nutation (luni-solar + planetary). 

10693 

10694 8) The matrix rbpn transforms vectors from GCRS to true equator and 

10695 equinox of date. It is the product rn x rbp, applying frame 

10696 bias, precession and nutation in that order. 

10697 

10698 9) The X,Y,Z coordinates of the Celestial Intermediate Pole are 

10699 elements (3,1-3) of the GCRS-to-true matrix, i.e. rbpn[2][0-2]. 

10700 

10701 10) It is permissible to re-use the same array in the returned 

10702 arguments. The arrays are filled in the stated order. 

10703 

10704 Called: 

10705 eraPfw06 bias-precession F-W angles, IAU 2006 

10706 eraFw2m F-W angles to r-matrix 

10707 eraCr copy r-matrix 

10708 eraTr transpose r-matrix 

10709 eraRxr product of two r-matrices 

10710 

10711 References: 

10712 

10713 Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 

10714 

10715 Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 

10716 

10717 This revision: 2021 May 11 

10718 

10719 Copyright (C) 2013-2021, NumFOCUS Foundation. 

10720 Derived, with permission, from the SOFA library. See notes at end of file. 

10721 

10722 """ 

10723 epsa, rb, rp, rbp, rn, rbpn = ufunc.pn06(date1, date2, dpsi, deps) 

10724 return epsa, rb, rp, rbp, rn, rbpn 

10725 

10726 

10727def pn06a(date1, date2): 

10728 """ 

10729 Precession-nutation, IAU 2006/2000A models: a multi-purpose function, 

10730 supporting classical (equinox-based) use directly and CIO-based use 

10731 indirectly. 

10732 

10733 Parameters 

10734 ---------- 

10735 date1 : double array 

10736 date2 : double array 

10737 

10738 Returns 

10739 ------- 

10740 dpsi : double array 

10741 deps : double array 

10742 epsa : double array 

10743 rb : double array 

10744 rp : double array 

10745 rbp : double array 

10746 rn : double array 

10747 rbpn : double array 

10748 

10749 Notes 

10750 ----- 

10751 Wraps ERFA function ``eraPn06a``. The ERFA documentation is:: 

10752 

10753 - - - - - - - - - 

10754 e r a P n 0 6 a 

10755 - - - - - - - - - 

10756 

10757 Precession-nutation, IAU 2006/2000A models: a multi-purpose function, 

10758 supporting classical (equinox-based) use directly and CIO-based use 

10759 indirectly. 

10760 

10761 Given: 

10762 date1,date2 double TT as a 2-part Julian Date (Note 1) 

10763 

10764 Returned: 

10765 dpsi,deps double nutation (Note 2) 

10766 epsa double mean obliquity (Note 3) 

10767 rb double[3][3] frame bias matrix (Note 4) 

10768 rp double[3][3] precession matrix (Note 5) 

10769 rbp double[3][3] bias-precession matrix (Note 6) 

10770 rn double[3][3] nutation matrix (Note 7) 

10771 rbpn double[3][3] GCRS-to-true matrix (Notes 8,9) 

10772 

10773 Notes: 

10774 

10775 1) The TT date date1+date2 is a Julian Date, apportioned in any 

10776 convenient way between the two arguments. For example, 

10777 JD(TT)=2450123.7 could be expressed in any of these ways, 

10778 among others: 

10779 

10780 date1 date2 

10781 

10782 2450123.7 0.0 (JD method) 

10783 2451545.0 -1421.3 (J2000 method) 

10784 2400000.5 50123.2 (MJD method) 

10785 2450123.5 0.2 (date & time method) 

10786 

10787 The JD method is the most natural and convenient to use in 

10788 cases where the loss of several decimal digits of resolution 

10789 is acceptable. The J2000 method is best matched to the way 

10790 the argument is handled internally and will deliver the 

10791 optimum resolution. The MJD method and the date & time methods 

10792 are both good compromises between resolution and convenience. 

10793 

10794 2) The nutation components (luni-solar + planetary, IAU 2000A) in 

10795 longitude and obliquity are in radians and with respect to the 

10796 equinox and ecliptic of date. Free core nutation is omitted; 

10797 for the utmost accuracy, use the eraPn06 function, where the 

10798 nutation components are caller-specified. 

10799 

10800 3) The mean obliquity is consistent with the IAU 2006 precession. 

10801 

10802 4) The matrix rb transforms vectors from GCRS to mean J2000.0 by 

10803 applying frame bias. 

10804 

10805 5) The matrix rp transforms vectors from mean J2000.0 to mean of 

10806 date by applying precession. 

10807 

10808 6) The matrix rbp transforms vectors from GCRS to mean of date by 

10809 applying frame bias then precession. It is the product rp x rb. 

10810 

10811 7) The matrix rn transforms vectors from mean of date to true of 

10812 date by applying the nutation (luni-solar + planetary). 

10813 

10814 8) The matrix rbpn transforms vectors from GCRS to true of date 

10815 (CIP/equinox). It is the product rn x rbp, applying frame bias, 

10816 precession and nutation in that order. 

10817 

10818 9) The X,Y,Z coordinates of the IAU 2006/2000A Celestial 

10819 Intermediate Pole are elements (3,1-3) of the GCRS-to-true 

10820 matrix, i.e. rbpn[2][0-2]. 

10821 

10822 10) It is permissible to re-use the same array in the returned 

10823 arguments. The arrays are filled in the stated order. 

10824 

10825 Called: 

10826 eraNut06a nutation, IAU 2006/2000A 

10827 eraPn06 bias/precession/nutation results, IAU 2006 

10828 

10829 Reference: 

10830 

10831 Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 

10832 

10833 This revision: 2021 May 11 

10834 

10835 Copyright (C) 2013-2021, NumFOCUS Foundation. 

10836 Derived, with permission, from the SOFA library. See notes at end of file. 

10837 

10838 """ 

10839 dpsi, deps, epsa, rb, rp, rbp, rn, rbpn = ufunc.pn06a(date1, date2) 

10840 return dpsi, deps, epsa, rb, rp, rbp, rn, rbpn 

10841 

10842 

10843def pnm00a(date1, date2): 

10844 """ 

10845 Form the matrix of precession-nutation for a given date (including 

10846 frame bias), equinox based, IAU 2000A model. 

10847 

10848 Parameters 

10849 ---------- 

10850 date1 : double array 

10851 date2 : double array 

10852 

10853 Returns 

10854 ------- 

10855 rbpn : double array 

10856 

10857 Notes 

10858 ----- 

10859 Wraps ERFA function ``eraPnm00a``. The ERFA documentation is:: 

10860 

10861 - - - - - - - - - - 

10862 e r a P n m 0 0 a 

10863 - - - - - - - - - - 

10864 

10865 Form the matrix of precession-nutation for a given date (including 

10866 frame bias), equinox based, IAU 2000A model. 

10867 

10868 Given: 

10869 date1,date2 double TT as a 2-part Julian Date (Note 1) 

10870 

10871 Returned: 

10872 rbpn double[3][3] bias-precession-nutation matrix (Note 2) 

10873 

10874 Notes: 

10875 

10876 1) The TT date date1+date2 is a Julian Date, apportioned in any 

10877 convenient way between the two arguments. For example, 

10878 JD(TT)=2450123.7 could be expressed in any of these ways, among 

10879 others: 

10880 

10881 date1 date2 

10882 

10883 2450123.7 0.0 (JD method) 

10884 2451545.0 -1421.3 (J2000 method) 

10885 2400000.5 50123.2 (MJD method) 

10886 2450123.5 0.2 (date & time method) 

10887 

10888 The JD method is the most natural and convenient to use in 

10889 cases where the loss of several decimal digits of resolution 

10890 is acceptable. The J2000 method is best matched to the way 

10891 the argument is handled internally and will deliver the 

10892 optimum resolution. The MJD method and the date & time methods 

10893 are both good compromises between resolution and convenience. 

10894 

10895 2) The matrix operates in the sense V(date) = rbpn * V(GCRS), where 

10896 the p-vector V(date) is with respect to the true equatorial triad 

10897 of date date1+date2 and the p-vector V(GCRS) is with respect to 

10898 the Geocentric Celestial Reference System (IAU, 2000). 

10899 

10900 3) A faster, but slightly less accurate, result (about 1 mas) can be 

10901 obtained by using instead the eraPnm00b function. 

10902 

10903 Called: 

10904 eraPn00a bias/precession/nutation, IAU 2000A 

10905 

10906 Reference: 

10907 

10908 IAU: Trans. International Astronomical Union, Vol. XXIVB; Proc. 

10909 24th General Assembly, Manchester, UK. Resolutions B1.3, B1.6. 

10910 (2000) 

10911 

10912 This revision: 2021 May 11 

10913 

10914 Copyright (C) 2013-2021, NumFOCUS Foundation. 

10915 Derived, with permission, from the SOFA library. See notes at end of file. 

10916 

10917 """ 

10918 rbpn = ufunc.pnm00a(date1, date2) 

10919 return rbpn 

10920 

10921 

10922def pnm00b(date1, date2): 

10923 """ 

10924 Form the matrix of precession-nutation for a given date (including 

10925 frame bias), equinox-based, IAU 2000B model. 

10926 

10927 Parameters 

10928 ---------- 

10929 date1 : double array 

10930 date2 : double array 

10931 

10932 Returns 

10933 ------- 

10934 rbpn : double array 

10935 

10936 Notes 

10937 ----- 

10938 Wraps ERFA function ``eraPnm00b``. The ERFA documentation is:: 

10939 

10940 - - - - - - - - - - 

10941 e r a P n m 0 0 b 

10942 - - - - - - - - - - 

10943 

10944 Form the matrix of precession-nutation for a given date (including 

10945 frame bias), equinox-based, IAU 2000B model. 

10946 

10947 Given: 

10948 date1,date2 double TT as a 2-part Julian Date (Note 1) 

10949 

10950 Returned: 

10951 rbpn double[3][3] bias-precession-nutation matrix (Note 2) 

10952 

10953 Notes: 

10954 

10955 1) The TT date date1+date2 is a Julian Date, apportioned in any 

10956 convenient way between the two arguments. For example, 

10957 JD(TT)=2450123.7 could be expressed in any of these ways, among 

10958 others: 

10959 

10960 date1 date2 

10961 

10962 2450123.7 0.0 (JD method) 

10963 2451545.0 -1421.3 (J2000 method) 

10964 2400000.5 50123.2 (MJD method) 

10965 2450123.5 0.2 (date & time method) 

10966 

10967 The JD method is the most natural and convenient to use in 

10968 cases where the loss of several decimal digits of resolution 

10969 is acceptable. The J2000 method is best matched to the way 

10970 the argument is handled internally and will deliver the 

10971 optimum resolution. The MJD method and the date & time methods 

10972 are both good compromises between resolution and convenience. 

10973 

10974 2) The matrix operates in the sense V(date) = rbpn * V(GCRS), where 

10975 the p-vector V(date) is with respect to the true equatorial triad 

10976 of date date1+date2 and the p-vector V(GCRS) is with respect to 

10977 the Geocentric Celestial Reference System (IAU, 2000). 

10978 

10979 3) The present function is faster, but slightly less accurate (about 

10980 1 mas), than the eraPnm00a function. 

10981 

10982 Called: 

10983 eraPn00b bias/precession/nutation, IAU 2000B 

10984 

10985 Reference: 

10986 

10987 IAU: Trans. International Astronomical Union, Vol. XXIVB; Proc. 

10988 24th General Assembly, Manchester, UK. Resolutions B1.3, B1.6. 

10989 (2000) 

10990 

10991 This revision: 2021 May 11 

10992 

10993 Copyright (C) 2013-2021, NumFOCUS Foundation. 

10994 Derived, with permission, from the SOFA library. See notes at end of file. 

10995 

10996 """ 

10997 rbpn = ufunc.pnm00b(date1, date2) 

10998 return rbpn 

10999 

11000 

11001def pnm06a(date1, date2): 

11002 """ 

11003 Form the matrix of precession-nutation for a given date (including 

11004 frame bias), equinox based, IAU 2006 precession and IAU 2000A 

11005 nutation models. 

11006 

11007 Parameters 

11008 ---------- 

11009 date1 : double array 

11010 date2 : double array 

11011 

11012 Returns 

11013 ------- 

11014 rbpn : double array 

11015 

11016 Notes 

11017 ----- 

11018 Wraps ERFA function ``eraPnm06a``. The ERFA documentation is:: 

11019 

11020 - - - - - - - - - - 

11021 e r a P n m 0 6 a 

11022 - - - - - - - - - - 

11023 

11024 Form the matrix of precession-nutation for a given date (including 

11025 frame bias), equinox based, IAU 2006 precession and IAU 2000A 

11026 nutation models. 

11027 

11028 Given: 

11029 date1,date2 double TT as a 2-part Julian Date (Note 1) 

11030 

11031 Returned: 

11032 rbpn double[3][3] bias-precession-nutation matrix (Note 2) 

11033 

11034 Notes: 

11035 

11036 1) The TT date date1+date2 is a Julian Date, apportioned in any 

11037 convenient way between the two arguments. For example, 

11038 JD(TT)=2450123.7 could be expressed in any of these ways, among 

11039 others: 

11040 

11041 date1 date2 

11042 

11043 2450123.7 0.0 (JD method) 

11044 2451545.0 -1421.3 (J2000 method) 

11045 2400000.5 50123.2 (MJD method) 

11046 2450123.5 0.2 (date & time method) 

11047 

11048 The JD method is the most natural and convenient to use in 

11049 cases where the loss of several decimal digits of resolution 

11050 is acceptable. The J2000 method is best matched to the way 

11051 the argument is handled internally and will deliver the 

11052 optimum resolution. The MJD method and the date & time methods 

11053 are both good compromises between resolution and convenience. 

11054 

11055 2) The matrix operates in the sense V(date) = rbpn * V(GCRS), where 

11056 the p-vector V(date) is with respect to the true equatorial triad 

11057 of date date1+date2 and the p-vector V(GCRS) is with respect to 

11058 the Geocentric Celestial Reference System (IAU, 2000). 

11059 

11060 Called: 

11061 eraPfw06 bias-precession F-W angles, IAU 2006 

11062 eraNut06a nutation, IAU 2006/2000A 

11063 eraFw2m F-W angles to r-matrix 

11064 

11065 Reference: 

11066 

11067 Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855. 

11068 

11069 This revision: 2021 May 11 

11070 

11071 Copyright (C) 2013-2021, NumFOCUS Foundation. 

11072 Derived, with permission, from the SOFA library. See notes at end of file. 

11073 

11074 """ 

11075 rbpn = ufunc.pnm06a(date1, date2) 

11076 return rbpn 

11077 

11078 

11079def pnm80(date1, date2): 

11080 """ 

11081 Form the matrix of precession/nutation for a given date, IAU 1976 

11082 precession model, IAU 1980 nutation model. 

11083 

11084 Parameters 

11085 ---------- 

11086 date1 : double array 

11087 date2 : double array 

11088 

11089 Returns 

11090 ------- 

11091 rmatpn : double array 

11092 

11093 Notes 

11094 ----- 

11095 Wraps ERFA function ``eraPnm80``. The ERFA documentation is:: 

11096 

11097 - - - - - - - - - 

11098 e r a P n m 8 0 

11099 - - - - - - - - - 

11100 

11101 Form the matrix of precession/nutation for a given date, IAU 1976 

11102 precession model, IAU 1980 nutation model. 

11103 

11104 Given: 

11105 date1,date2 double TT as a 2-part Julian Date (Note 1) 

11106 

11107 Returned: 

11108 rmatpn double[3][3] combined precession/nutation matrix 

11109 

11110 Notes: 

11111 

11112 1) The TT date date1+date2 is a Julian Date, apportioned in any 

11113 convenient way between the two arguments. For example, 

11114 JD(TT)=2450123.7 could be expressed in any of these ways, 

11115 among others: 

11116 

11117 date1 date2 

11118 

11119 2450123.7 0.0 (JD method) 

11120 2451545.0 -1421.3 (J2000 method) 

11121 2400000.5 50123.2 (MJD method) 

11122 2450123.5 0.2 (date & time method) 

11123 

11124 The JD method is the most natural and convenient to use in 

11125 cases where the loss of several decimal digits of resolution 

11126 is acceptable. The J2000 method is best matched to the way 

11127 the argument is handled internally and will deliver the 

11128 optimum resolution. The MJD method and the date & time methods 

11129 are both good compromises between resolution and convenience. 

11130 

11131 2) The matrix operates in the sense V(date) = rmatpn * V(J2000), 

11132 where the p-vector V(date) is with respect to the true equatorial 

11133 triad of date date1+date2 and the p-vector V(J2000) is with 

11134 respect to the mean equatorial triad of epoch J2000.0. 

11135 

11136 Called: 

11137 eraPmat76 precession matrix, IAU 1976 

11138 eraNutm80 nutation matrix, IAU 1980 

11139 eraRxr product of two r-matrices 

11140 

11141 Reference: 

11142 

11143 Explanatory Supplement to the Astronomical Almanac, 

11144 P. Kenneth Seidelmann (ed), University Science Books (1992), 

11145 Section 3.3 (p145). 

11146 

11147 This revision: 2021 May 11 

11148 

11149 Copyright (C) 2013-2021, NumFOCUS Foundation. 

11150 Derived, with permission, from the SOFA library. See notes at end of file. 

11151 

11152 """ 

11153 rmatpn = ufunc.pnm80(date1, date2) 

11154 return rmatpn 

11155 

11156 

11157def pom00(xp, yp, sp): 

11158 """ 

11159 Form the matrix of polar motion for a given date, IAU 2000. 

11160 

11161 Parameters 

11162 ---------- 

11163 xp : double array 

11164 yp : double array 

11165 sp : double array 

11166 

11167 Returns 

11168 ------- 

11169 rpom : double array 

11170 

11171 Notes 

11172 ----- 

11173 Wraps ERFA function ``eraPom00``. The ERFA documentation is:: 

11174 

11175 - - - - - - - - - - 

11176 e r a P o m 0 0 

11177 - - - - - - - - - - 

11178 

11179 Form the matrix of polar motion for a given date, IAU 2000. 

11180 

11181 Given: 

11182 xp,yp double coordinates of the pole (radians, Note 1) 

11183 sp double the TIO locator s' (radians, Note 2) 

11184 

11185 Returned: 

11186 rpom double[3][3] polar-motion matrix (Note 3) 

11187 

11188 Notes: 

11189 

11190 1) The arguments xp and yp are the coordinates (in radians) of the 

11191 Celestial Intermediate Pole with respect to the International 

11192 Terrestrial Reference System (see IERS Conventions 2003), 

11193 measured along the meridians 0 and 90 deg west respectively. 

11194 

11195 2) The argument sp is the TIO locator s', in radians, which 

11196 positions the Terrestrial Intermediate Origin on the equator. It 

11197 is obtained from polar motion observations by numerical 

11198 integration, and so is in essence unpredictable. However, it is 

11199 dominated by a secular drift of about 47 microarcseconds per 

11200 century, and so can be taken into account by using s' = -47*t, 

11201 where t is centuries since J2000.0. The function eraSp00 

11202 implements this approximation. 

11203 

11204 3) The matrix operates in the sense V(TRS) = rpom * V(CIP), meaning 

11205 that it is the final rotation when computing the pointing 

11206 direction to a celestial source. 

11207 

11208 Called: 

11209 eraIr initialize r-matrix to identity 

11210 eraRz rotate around Z-axis 

11211 eraRy rotate around Y-axis 

11212 eraRx rotate around X-axis 

11213 

11214 Reference: 

11215 

11216 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

11217 IERS Technical Note No. 32, BKG (2004) 

11218 

11219 This revision: 2021 May 11 

11220 

11221 Copyright (C) 2013-2021, NumFOCUS Foundation. 

11222 Derived, with permission, from the SOFA library. See notes at end of file. 

11223 

11224 """ 

11225 rpom = ufunc.pom00(xp, yp, sp) 

11226 return rpom 

11227 

11228 

11229def pr00(date1, date2): 

11230 """ 

11231 Precession-rate part of the IAU 2000 precession-nutation models 

11232 (part of MHB2000). 

11233 

11234 Parameters 

11235 ---------- 

11236 date1 : double array 

11237 date2 : double array 

11238 

11239 Returns 

11240 ------- 

11241 dpsipr : double array 

11242 depspr : double array 

11243 

11244 Notes 

11245 ----- 

11246 Wraps ERFA function ``eraPr00``. The ERFA documentation is:: 

11247 

11248 - - - - - - - - 

11249 e r a P r 0 0 

11250 - - - - - - - - 

11251 

11252 Precession-rate part of the IAU 2000 precession-nutation models 

11253 (part of MHB2000). 

11254 

11255 Given: 

11256 date1,date2 double TT as a 2-part Julian Date (Note 1) 

11257 

11258 Returned: 

11259 dpsipr,depspr double precession corrections (Notes 2,3) 

11260 

11261 Notes: 

11262 

11263 1) The TT date date1+date2 is a Julian Date, apportioned in any 

11264 convenient way between the two arguments. For example, 

11265 JD(TT)=2450123.7 could be expressed in any of these ways, 

11266 among others: 

11267 

11268 date1 date2 

11269 

11270 2450123.7 0.0 (JD method) 

11271 2451545.0 -1421.3 (J2000 method) 

11272 2400000.5 50123.2 (MJD method) 

11273 2450123.5 0.2 (date & time method) 

11274 

11275 The JD method is the most natural and convenient to use in 

11276 cases where the loss of several decimal digits of resolution 

11277 is acceptable. The J2000 method is best matched to the way 

11278 the argument is handled internally and will deliver the 

11279 optimum resolution. The MJD method and the date & time methods 

11280 are both good compromises between resolution and convenience. 

11281 

11282 2) The precession adjustments are expressed as "nutation 

11283 components", corrections in longitude and obliquity with respect 

11284 to the J2000.0 equinox and ecliptic. 

11285 

11286 3) Although the precession adjustments are stated to be with respect 

11287 to Lieske et al. (1977), the MHB2000 model does not specify which 

11288 set of Euler angles are to be used and how the adjustments are to 

11289 be applied. The most literal and straightforward procedure is to 

11290 adopt the 4-rotation epsilon_0, psi_A, omega_A, xi_A option, and 

11291 to add dpsipr to psi_A and depspr to both omega_A and eps_A. 

11292 

11293 4) This is an implementation of one aspect of the IAU 2000A nutation 

11294 model, formally adopted by the IAU General Assembly in 2000, 

11295 namely MHB2000 (Mathews et al. 2002). 

11296 

11297 References: 

11298 

11299 Lieske, J.H., Lederle, T., Fricke, W. & Morando, B., "Expressions 

11300 for the precession quantities based upon the IAU (1976) System of 

11301 Astronomical Constants", Astron.Astrophys., 58, 1-16 (1977) 

11302 

11303 Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation 

11304 and precession New nutation series for nonrigid Earth and 

11305 insights into the Earth's interior", J.Geophys.Res., 107, B4, 

11306 2002. The MHB2000 code itself was obtained on 9th September 2002 

11307 from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A. 

11308 

11309 Wallace, P.T., "Software for Implementing the IAU 2000 

11310 Resolutions", in IERS Workshop 5.1 (2002). 

11311 

11312 This revision: 2021 May 11 

11313 

11314 Copyright (C) 2013-2021, NumFOCUS Foundation. 

11315 Derived, with permission, from the SOFA library. See notes at end of file. 

11316 

11317 """ 

11318 dpsipr, depspr = ufunc.pr00(date1, date2) 

11319 return dpsipr, depspr 

11320 

11321 

11322def prec76(date01, date02, date11, date12): 

11323 """ 

11324 IAU 1976 precession model. 

11325 

11326 Parameters 

11327 ---------- 

11328 date01 : double array 

11329 date02 : double array 

11330 date11 : double array 

11331 date12 : double array 

11332 

11333 Returns 

11334 ------- 

11335 zeta : double array 

11336 z : double array 

11337 theta : double array 

11338 

11339 Notes 

11340 ----- 

11341 Wraps ERFA function ``eraPrec76``. The ERFA documentation is:: 

11342 

11343 - - - - - - - - - - 

11344 e r a P r e c 7 6 

11345 - - - - - - - - - - 

11346 

11347 IAU 1976 precession model. 

11348 

11349 This function forms the three Euler angles which implement general 

11350 precession between two dates, using the IAU 1976 model (as for the 

11351 FK5 catalog). 

11352 

11353 Given: 

11354 date01,date02 double TDB starting date (Note 1) 

11355 date11,date12 double TDB ending date (Note 1) 

11356 

11357 Returned: 

11358 zeta double 1st rotation: radians cw around z 

11359 z double 3rd rotation: radians cw around z 

11360 theta double 2nd rotation: radians ccw around y 

11361 

11362 Notes: 

11363 

11364 1) The dates date01+date02 and date11+date12 are Julian Dates, 

11365 apportioned in any convenient way between the arguments daten1 

11366 and daten2. For example, JD(TDB)=2450123.7 could be expressed in 

11367 any of these ways, among others: 

11368 

11369 daten1 daten2 

11370 

11371 2450123.7 0.0 (JD method) 

11372 2451545.0 -1421.3 (J2000 method) 

11373 2400000.5 50123.2 (MJD method) 

11374 2450123.5 0.2 (date & time method) 

11375 

11376 The JD method is the most natural and convenient to use in cases 

11377 where the loss of several decimal digits of resolution is 

11378 acceptable. The J2000 method is best matched to the way the 

11379 argument is handled internally and will deliver the optimum 

11380 optimum resolution. The MJD method and the date & time methods 

11381 are both good compromises between resolution and convenience. 

11382 The two dates may be expressed using different methods, but at 

11383 the risk of losing some resolution. 

11384 

11385 2) The accumulated precession angles zeta, z, theta are expressed 

11386 through canonical polynomials which are valid only for a limited 

11387 time span. In addition, the IAU 1976 precession rate is known to 

11388 be imperfect. The absolute accuracy of the present formulation 

11389 is better than 0.1 arcsec from 1960AD to 2040AD, better than 

11390 1 arcsec from 1640AD to 2360AD, and remains below 3 arcsec for 

11391 the whole of the period 500BC to 3000AD. The errors exceed 

11392 10 arcsec outside the range 1200BC to 3900AD, exceed 100 arcsec 

11393 outside 4200BC to 5600AD and exceed 1000 arcsec outside 6800BC to 

11394 8200AD. 

11395 

11396 3) The three angles are returned in the conventional order, which 

11397 is not the same as the order of the corresponding Euler 

11398 rotations. The precession matrix is 

11399 R_3(-z) x R_2(+theta) x R_3(-zeta). 

11400 

11401 Reference: 

11402 

11403 Lieske, J.H., 1979, Astron.Astrophys. 73, 282, equations 

11404 (6) & (7), p283. 

11405 

11406 This revision: 2021 May 11 

11407 

11408 Copyright (C) 2013-2021, NumFOCUS Foundation. 

11409 Derived, with permission, from the SOFA library. See notes at end of file. 

11410 

11411 """ 

11412 zeta, z, theta = ufunc.prec76(date01, date02, date11, date12) 

11413 return zeta, z, theta 

11414 

11415 

11416def s00(date1, date2, x, y): 

11417 """ 

11418 The CIO locator s, positioning the Celestial Intermediate Origin on 

11419 the equator of the Celestial Intermediate Pole, given the CIP's X,Y 

11420 coordinates. 

11421 

11422 Parameters 

11423 ---------- 

11424 date1 : double array 

11425 date2 : double array 

11426 x : double array 

11427 y : double array 

11428 

11429 Returns 

11430 ------- 

11431 c_retval : double array 

11432 

11433 Notes 

11434 ----- 

11435 Wraps ERFA function ``eraS00``. The ERFA documentation is:: 

11436 

11437 - - - - - - - 

11438 e r a S 0 0 

11439 - - - - - - - 

11440 

11441 The CIO locator s, positioning the Celestial Intermediate Origin on 

11442 the equator of the Celestial Intermediate Pole, given the CIP's X,Y 

11443 coordinates. Compatible with IAU 2000A precession-nutation. 

11444 

11445 Given: 

11446 date1,date2 double TT as a 2-part Julian Date (Note 1) 

11447 x,y double CIP coordinates (Note 3) 

11448 

11449 Returned (function value): 

11450 double the CIO locator s in radians (Note 2) 

11451 

11452 Notes: 

11453 

11454 1) The TT date date1+date2 is a Julian Date, apportioned in any 

11455 convenient way between the two arguments. For example, 

11456 JD(TT)=2450123.7 could be expressed in any of these ways, 

11457 among others: 

11458 

11459 date1 date2 

11460 

11461 2450123.7 0.0 (JD method) 

11462 2451545.0 -1421.3 (J2000 method) 

11463 2400000.5 50123.2 (MJD method) 

11464 2450123.5 0.2 (date & time method) 

11465 

11466 The JD method is the most natural and convenient to use in 

11467 cases where the loss of several decimal digits of resolution 

11468 is acceptable. The J2000 method is best matched to the way 

11469 the argument is handled internally and will deliver the 

11470 optimum resolution. The MJD method and the date & time methods 

11471 are both good compromises between resolution and convenience. 

11472 

11473 2) The CIO locator s is the difference between the right ascensions 

11474 of the same point in two systems: the two systems are the GCRS 

11475 and the CIP,CIO, and the point is the ascending node of the 

11476 CIP equator. The quantity s remains below 0.1 arcsecond 

11477 throughout 1900-2100. 

11478 

11479 3) The series used to compute s is in fact for s+XY/2, where X and Y 

11480 are the x and y components of the CIP unit vector; this series 

11481 is more compact than a direct series for s would be. This 

11482 function requires X,Y to be supplied by the caller, who is 

11483 responsible for providing values that are consistent with the 

11484 supplied date. 

11485 

11486 4) The model is consistent with the IAU 2000A precession-nutation. 

11487 

11488 Called: 

11489 eraFal03 mean anomaly of the Moon 

11490 eraFalp03 mean anomaly of the Sun 

11491 eraFaf03 mean argument of the latitude of the Moon 

11492 eraFad03 mean elongation of the Moon from the Sun 

11493 eraFaom03 mean longitude of the Moon's ascending node 

11494 eraFave03 mean longitude of Venus 

11495 eraFae03 mean longitude of Earth 

11496 eraFapa03 general accumulated precession in longitude 

11497 

11498 References: 

11499 

11500 Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., 

11501 "Expressions for the Celestial Intermediate Pole and Celestial 

11502 Ephemeris Origin consistent with the IAU 2000A precession- 

11503 nutation model", Astron.Astrophys. 400, 1145-1154 (2003) 

11504 

11505 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

11506 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

11507 

11508 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

11509 IERS Technical Note No. 32, BKG (2004) 

11510 

11511 This revision: 2021 May 11 

11512 

11513 Copyright (C) 2013-2021, NumFOCUS Foundation. 

11514 Derived, with permission, from the SOFA library. See notes at end of file. 

11515 

11516 """ 

11517 c_retval = ufunc.s00(date1, date2, x, y) 

11518 return c_retval 

11519 

11520 

11521def s00a(date1, date2): 

11522 """ 

11523 The CIO locator s, positioning the Celestial Intermediate Origin on 

11524 the equator of the Celestial Intermediate Pole, using the IAU 2000A 

11525 precession-nutation model. 

11526 

11527 Parameters 

11528 ---------- 

11529 date1 : double array 

11530 date2 : double array 

11531 

11532 Returns 

11533 ------- 

11534 c_retval : double array 

11535 

11536 Notes 

11537 ----- 

11538 Wraps ERFA function ``eraS00a``. The ERFA documentation is:: 

11539 

11540 - - - - - - - - 

11541 e r a S 0 0 a 

11542 - - - - - - - - 

11543 

11544 The CIO locator s, positioning the Celestial Intermediate Origin on 

11545 the equator of the Celestial Intermediate Pole, using the IAU 2000A 

11546 precession-nutation model. 

11547 

11548 Given: 

11549 date1,date2 double TT as a 2-part Julian Date (Note 1) 

11550 

11551 Returned (function value): 

11552 double the CIO locator s in radians (Note 2) 

11553 

11554 Notes: 

11555 

11556 1) The TT date date1+date2 is a Julian Date, apportioned in any 

11557 convenient way between the two arguments. For example, 

11558 JD(TT)=2450123.7 could be expressed in any of these ways, 

11559 among others: 

11560 

11561 date1 date2 

11562 

11563 2450123.7 0.0 (JD method) 

11564 2451545.0 -1421.3 (J2000 method) 

11565 2400000.5 50123.2 (MJD method) 

11566 2450123.5 0.2 (date & time method) 

11567 

11568 The JD method is the most natural and convenient to use in 

11569 cases where the loss of several decimal digits of resolution 

11570 is acceptable. The J2000 method is best matched to the way 

11571 the argument is handled internally and will deliver the 

11572 optimum resolution. The MJD method and the date & time methods 

11573 are both good compromises between resolution and convenience. 

11574 

11575 2) The CIO locator s is the difference between the right ascensions 

11576 of the same point in two systems. The two systems are the GCRS 

11577 and the CIP,CIO, and the point is the ascending node of the 

11578 CIP equator. The CIO locator s remains a small fraction of 

11579 1 arcsecond throughout 1900-2100. 

11580 

11581 3) The series used to compute s is in fact for s+XY/2, where X and Y 

11582 are the x and y components of the CIP unit vector; this series 

11583 is more compact than a direct series for s would be. The present 

11584 function uses the full IAU 2000A nutation model when predicting 

11585 the CIP position. Faster results, with no significant loss of 

11586 accuracy, can be obtained via the function eraS00b, which uses 

11587 instead the IAU 2000B truncated model. 

11588 

11589 Called: 

11590 eraPnm00a classical NPB matrix, IAU 2000A 

11591 eraBnp2xy extract CIP X,Y from the BPN matrix 

11592 eraS00 the CIO locator s, given X,Y, IAU 2000A 

11593 

11594 References: 

11595 

11596 Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., 

11597 "Expressions for the Celestial Intermediate Pole and Celestial 

11598 Ephemeris Origin consistent with the IAU 2000A precession- 

11599 nutation model", Astron.Astrophys. 400, 1145-1154 (2003) 

11600 

11601 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

11602 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

11603 

11604 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

11605 IERS Technical Note No. 32, BKG (2004) 

11606 

11607 This revision: 2021 May 11 

11608 

11609 Copyright (C) 2013-2021, NumFOCUS Foundation. 

11610 Derived, with permission, from the SOFA library. See notes at end of file. 

11611 

11612 """ 

11613 c_retval = ufunc.s00a(date1, date2) 

11614 return c_retval 

11615 

11616 

11617def s00b(date1, date2): 

11618 """ 

11619 The CIO locator s, positioning the Celestial Intermediate Origin on 

11620 the equator of the Celestial Intermediate Pole, using the IAU 2000B 

11621 precession-nutation model. 

11622 

11623 Parameters 

11624 ---------- 

11625 date1 : double array 

11626 date2 : double array 

11627 

11628 Returns 

11629 ------- 

11630 c_retval : double array 

11631 

11632 Notes 

11633 ----- 

11634 Wraps ERFA function ``eraS00b``. The ERFA documentation is:: 

11635 

11636 - - - - - - - - 

11637 e r a S 0 0 b 

11638 - - - - - - - - 

11639 

11640 The CIO locator s, positioning the Celestial Intermediate Origin on 

11641 the equator of the Celestial Intermediate Pole, using the IAU 2000B 

11642 precession-nutation model. 

11643 

11644 Given: 

11645 date1,date2 double TT as a 2-part Julian Date (Note 1) 

11646 

11647 Returned (function value): 

11648 double the CIO locator s in radians (Note 2) 

11649 

11650 Notes: 

11651 

11652 1) The TT date date1+date2 is a Julian Date, apportioned in any 

11653 convenient way between the two arguments. For example, 

11654 JD(TT)=2450123.7 could be expressed in any of these ways, 

11655 among others: 

11656 

11657 date1 date2 

11658 

11659 2450123.7 0.0 (JD method) 

11660 2451545.0 -1421.3 (J2000 method) 

11661 2400000.5 50123.2 (MJD method) 

11662 2450123.5 0.2 (date & time method) 

11663 

11664 The JD method is the most natural and convenient to use in 

11665 cases where the loss of several decimal digits of resolution 

11666 is acceptable. The J2000 method is best matched to the way 

11667 the argument is handled internally and will deliver the 

11668 optimum resolution. The MJD method and the date & time methods 

11669 are both good compromises between resolution and convenience. 

11670 

11671 2) The CIO locator s is the difference between the right ascensions 

11672 of the same point in two systems. The two systems are the GCRS 

11673 and the CIP,CIO, and the point is the ascending node of the 

11674 CIP equator. The CIO locator s remains a small fraction of 

11675 1 arcsecond throughout 1900-2100. 

11676 

11677 3) The series used to compute s is in fact for s+XY/2, where X and Y 

11678 are the x and y components of the CIP unit vector; this series 

11679 is more compact than a direct series for s would be. The present 

11680 function uses the IAU 2000B truncated nutation model when 

11681 predicting the CIP position. The function eraS00a uses instead 

11682 the full IAU 2000A model, but with no significant increase in 

11683 accuracy and at some cost in speed. 

11684 

11685 Called: 

11686 eraPnm00b classical NPB matrix, IAU 2000B 

11687 eraBnp2xy extract CIP X,Y from the BPN matrix 

11688 eraS00 the CIO locator s, given X,Y, IAU 2000A 

11689 

11690 References: 

11691 

11692 Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., 

11693 "Expressions for the Celestial Intermediate Pole and Celestial 

11694 Ephemeris Origin consistent with the IAU 2000A precession- 

11695 nutation model", Astron.Astrophys. 400, 1145-1154 (2003) 

11696 

11697 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

11698 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

11699 

11700 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

11701 IERS Technical Note No. 32, BKG (2004) 

11702 

11703 This revision: 2021 May 11 

11704 

11705 Copyright (C) 2013-2021, NumFOCUS Foundation. 

11706 Derived, with permission, from the SOFA library. See notes at end of file. 

11707 

11708 """ 

11709 c_retval = ufunc.s00b(date1, date2) 

11710 return c_retval 

11711 

11712 

11713def s06(date1, date2, x, y): 

11714 """ 

11715 The CIO locator s, positioning the Celestial Intermediate Origin on 

11716 the equator of the Celestial Intermediate Pole, given the CIP's X,Y 

11717 coordinates. 

11718 

11719 Parameters 

11720 ---------- 

11721 date1 : double array 

11722 date2 : double array 

11723 x : double array 

11724 y : double array 

11725 

11726 Returns 

11727 ------- 

11728 c_retval : double array 

11729 

11730 Notes 

11731 ----- 

11732 Wraps ERFA function ``eraS06``. The ERFA documentation is:: 

11733 

11734 - - - - - - - 

11735 e r a S 0 6 

11736 - - - - - - - 

11737 

11738 The CIO locator s, positioning the Celestial Intermediate Origin on 

11739 the equator of the Celestial Intermediate Pole, given the CIP's X,Y 

11740 coordinates. Compatible with IAU 2006/2000A precession-nutation. 

11741 

11742 Given: 

11743 date1,date2 double TT as a 2-part Julian Date (Note 1) 

11744 x,y double CIP coordinates (Note 3) 

11745 

11746 Returned (function value): 

11747 double the CIO locator s in radians (Note 2) 

11748 

11749 Notes: 

11750 

11751 1) The TT date date1+date2 is a Julian Date, apportioned in any 

11752 convenient way between the two arguments. For example, 

11753 JD(TT)=2450123.7 could be expressed in any of these ways, 

11754 among others: 

11755 

11756 date1 date2 

11757 

11758 2450123.7 0.0 (JD method) 

11759 2451545.0 -1421.3 (J2000 method) 

11760 2400000.5 50123.2 (MJD method) 

11761 2450123.5 0.2 (date & time method) 

11762 

11763 The JD method is the most natural and convenient to use in 

11764 cases where the loss of several decimal digits of resolution 

11765 is acceptable. The J2000 method is best matched to the way 

11766 the argument is handled internally and will deliver the 

11767 optimum resolution. The MJD method and the date & time methods 

11768 are both good compromises between resolution and convenience. 

11769 

11770 2) The CIO locator s is the difference between the right ascensions 

11771 of the same point in two systems: the two systems are the GCRS 

11772 and the CIP,CIO, and the point is the ascending node of the 

11773 CIP equator. The quantity s remains below 0.1 arcsecond 

11774 throughout 1900-2100. 

11775 

11776 3) The series used to compute s is in fact for s+XY/2, where X and Y 

11777 are the x and y components of the CIP unit vector; this series 

11778 is more compact than a direct series for s would be. This 

11779 function requires X,Y to be supplied by the caller, who is 

11780 responsible for providing values that are consistent with the 

11781 supplied date. 

11782 

11783 4) The model is consistent with the "P03" precession (Capitaine et 

11784 al. 2003), adopted by IAU 2006 Resolution 1, 2006, and the 

11785 IAU 2000A nutation (with P03 adjustments). 

11786 

11787 Called: 

11788 eraFal03 mean anomaly of the Moon 

11789 eraFalp03 mean anomaly of the Sun 

11790 eraFaf03 mean argument of the latitude of the Moon 

11791 eraFad03 mean elongation of the Moon from the Sun 

11792 eraFaom03 mean longitude of the Moon's ascending node 

11793 eraFave03 mean longitude of Venus 

11794 eraFae03 mean longitude of Earth 

11795 eraFapa03 general accumulated precession in longitude 

11796 

11797 References: 

11798 

11799 Capitaine, N., Wallace, P.T. & Chapront, J., 2003, Astron. 

11800 Astrophys. 432, 355 

11801 

11802 McCarthy, D.D., Petit, G. (eds.) 2004, IERS Conventions (2003), 

11803 IERS Technical Note No. 32, BKG 

11804 

11805 This revision: 2021 May 11 

11806 

11807 Copyright (C) 2013-2021, NumFOCUS Foundation. 

11808 Derived, with permission, from the SOFA library. See notes at end of file. 

11809 

11810 """ 

11811 c_retval = ufunc.s06(date1, date2, x, y) 

11812 return c_retval 

11813 

11814 

11815def s06a(date1, date2): 

11816 """ 

11817 The CIO locator s, positioning the Celestial Intermediate Origin on 

11818 the equator of the Celestial Intermediate Pole, using the IAU 2006 

11819 precession and IAU 2000A nutation models. 

11820 

11821 Parameters 

11822 ---------- 

11823 date1 : double array 

11824 date2 : double array 

11825 

11826 Returns 

11827 ------- 

11828 c_retval : double array 

11829 

11830 Notes 

11831 ----- 

11832 Wraps ERFA function ``eraS06a``. The ERFA documentation is:: 

11833 

11834 - - - - - - - - 

11835 e r a S 0 6 a 

11836 - - - - - - - - 

11837 

11838 The CIO locator s, positioning the Celestial Intermediate Origin on 

11839 the equator of the Celestial Intermediate Pole, using the IAU 2006 

11840 precession and IAU 2000A nutation models. 

11841 

11842 Given: 

11843 date1,date2 double TT as a 2-part Julian Date (Note 1) 

11844 

11845 Returned (function value): 

11846 double the CIO locator s in radians (Note 2) 

11847 

11848 Notes: 

11849 

11850 1) The TT date date1+date2 is a Julian Date, apportioned in any 

11851 convenient way between the two arguments. For example, 

11852 JD(TT)=2450123.7 could be expressed in any of these ways, 

11853 among others: 

11854 

11855 date1 date2 

11856 

11857 2450123.7 0.0 (JD method) 

11858 2451545.0 -1421.3 (J2000 method) 

11859 2400000.5 50123.2 (MJD method) 

11860 2450123.5 0.2 (date & time method) 

11861 

11862 The JD method is the most natural and convenient to use in 

11863 cases where the loss of several decimal digits of resolution 

11864 is acceptable. The J2000 method is best matched to the way 

11865 the argument is handled internally and will deliver the 

11866 optimum resolution. The MJD method and the date & time methods 

11867 are both good compromises between resolution and convenience. 

11868 

11869 2) The CIO locator s is the difference between the right ascensions 

11870 of the same point in two systems. The two systems are the GCRS 

11871 and the CIP,CIO, and the point is the ascending node of the 

11872 CIP equator. The CIO locator s remains a small fraction of 

11873 1 arcsecond throughout 1900-2100. 

11874 

11875 3) The series used to compute s is in fact for s+XY/2, where X and Y 

11876 are the x and y components of the CIP unit vector; this series is 

11877 more compact than a direct series for s would be. The present 

11878 function uses the full IAU 2000A nutation model when predicting 

11879 the CIP position. 

11880 

11881 Called: 

11882 eraPnm06a classical NPB matrix, IAU 2006/2000A 

11883 eraBpn2xy extract CIP X,Y coordinates from NPB matrix 

11884 eraS06 the CIO locator s, given X,Y, IAU 2006 

11885 

11886 References: 

11887 

11888 Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., 

11889 "Expressions for the Celestial Intermediate Pole and Celestial 

11890 Ephemeris Origin consistent with the IAU 2000A precession- 

11891 nutation model", Astron.Astrophys. 400, 1145-1154 (2003) 

11892 

11893 n.b. The celestial ephemeris origin (CEO) was renamed "celestial 

11894 intermediate origin" (CIO) by IAU 2006 Resolution 2. 

11895 

11896 Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 

11897 

11898 McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), 

11899 IERS Technical Note No. 32, BKG 

11900 

11901 Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 

11902 

11903 This revision: 2021 May 11 

11904 

11905 Copyright (C) 2013-2021, NumFOCUS Foundation. 

11906 Derived, with permission, from the SOFA library. See notes at end of file. 

11907 

11908 """ 

11909 c_retval = ufunc.s06a(date1, date2) 

11910 return c_retval 

11911 

11912 

11913def sp00(date1, date2): 

11914 """ 

11915 The TIO locator s', positioning the Terrestrial Intermediate Origin 

11916 on the equator of the Celestial Intermediate Pole. 

11917 

11918 Parameters 

11919 ---------- 

11920 date1 : double array 

11921 date2 : double array 

11922 

11923 Returns 

11924 ------- 

11925 c_retval : double array 

11926 

11927 Notes 

11928 ----- 

11929 Wraps ERFA function ``eraSp00``. The ERFA documentation is:: 

11930 

11931 - - - - - - - - 

11932 e r a S p 0 0 

11933 - - - - - - - - 

11934 

11935 The TIO locator s', positioning the Terrestrial Intermediate Origin 

11936 on the equator of the Celestial Intermediate Pole. 

11937 

11938 Given: 

11939 date1,date2 double TT as a 2-part Julian Date (Note 1) 

11940 

11941 Returned (function value): 

11942 double the TIO locator s' in radians (Note 2) 

11943 

11944 Notes: 

11945 

11946 1) The TT date date1+date2 is a Julian Date, apportioned in any 

11947 convenient way between the two arguments. For example, 

11948 JD(TT)=2450123.7 could be expressed in any of these ways, 

11949 among others: 

11950 

11951 date1 date2 

11952 

11953 2450123.7 0.0 (JD method) 

11954 2451545.0 -1421.3 (J2000 method) 

11955 2400000.5 50123.2 (MJD method) 

11956 2450123.5 0.2 (date & time method) 

11957 

11958 The JD method is the most natural and convenient to use in 

11959 cases where the loss of several decimal digits of resolution 

11960 is acceptable. The J2000 method is best matched to the way 

11961 the argument is handled internally and will deliver the 

11962 optimum resolution. The MJD method and the date & time methods 

11963 are both good compromises between resolution and convenience. 

11964 

11965 2) The TIO locator s' is obtained from polar motion observations by 

11966 numerical integration, and so is in essence unpredictable. 

11967 However, it is dominated by a secular drift of about 

11968 47 microarcseconds per century, which is the approximation 

11969 evaluated by the present function. 

11970 

11971 Reference: 

11972 

11973 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

11974 IERS Technical Note No. 32, BKG (2004) 

11975 

11976 This revision: 2021 May 11 

11977 

11978 Copyright (C) 2013-2021, NumFOCUS Foundation. 

11979 Derived, with permission, from the SOFA library. See notes at end of file. 

11980 

11981 """ 

11982 c_retval = ufunc.sp00(date1, date2) 

11983 return c_retval 

11984 

11985 

11986def xy06(date1, date2): 

11987 """ 

11988 X,Y coordinates of celestial intermediate pole from series based 

11989 on IAU 2006 precession and IAU 2000A nutation. 

11990 

11991 Parameters 

11992 ---------- 

11993 date1 : double array 

11994 date2 : double array 

11995 

11996 Returns 

11997 ------- 

11998 x : double array 

11999 y : double array 

12000 

12001 Notes 

12002 ----- 

12003 Wraps ERFA function ``eraXy06``. The ERFA documentation is:: 

12004 

12005 - - - - - - - - 

12006 e r a X y 0 6 

12007 - - - - - - - - 

12008 

12009 X,Y coordinates of celestial intermediate pole from series based 

12010 on IAU 2006 precession and IAU 2000A nutation. 

12011 

12012 Given: 

12013 date1,date2 double TT as a 2-part Julian Date (Note 1) 

12014 

12015 Returned: 

12016 x,y double CIP X,Y coordinates (Note 2) 

12017 

12018 Notes: 

12019 

12020 1) The TT date date1+date2 is a Julian Date, apportioned in any 

12021 convenient way between the two arguments. For example, 

12022 JD(TT)=2450123.7 could be expressed in any of these ways, 

12023 among others: 

12024 

12025 date1 date2 

12026 

12027 2450123.7 0.0 (JD method) 

12028 2451545.0 -1421.3 (J2000 method) 

12029 2400000.5 50123.2 (MJD method) 

12030 2450123.5 0.2 (date & time method) 

12031 

12032 The JD method is the most natural and convenient to use in 

12033 cases where the loss of several decimal digits of resolution 

12034 is acceptable. The J2000 method is best matched to the way 

12035 the argument is handled internally and will deliver the 

12036 optimum resolution. The MJD method and the date & time methods 

12037 are both good compromises between resolution and convenience. 

12038 

12039 2) The X,Y coordinates are those of the unit vector towards the 

12040 celestial intermediate pole. They represent the combined effects 

12041 of frame bias, precession and nutation. 

12042 

12043 3) The fundamental arguments used are as adopted in IERS Conventions 

12044 (2003) and are from Simon et al. (1994) and Souchay et al. 

12045 (1999). 

12046 

12047 4) This is an alternative to the angles-based method, via the ERFA 

12048 function eraFw2xy and as used in eraXys06a for example. The two 

12049 methods agree at the 1 microarcsecond level (at present), a 

12050 negligible amount compared with the intrinsic accuracy of the 

12051 models. However, it would be unwise to mix the two methods 

12052 (angles-based and series-based) in a single application. 

12053 

12054 Called: 

12055 eraFal03 mean anomaly of the Moon 

12056 eraFalp03 mean anomaly of the Sun 

12057 eraFaf03 mean argument of the latitude of the Moon 

12058 eraFad03 mean elongation of the Moon from the Sun 

12059 eraFaom03 mean longitude of the Moon's ascending node 

12060 eraFame03 mean longitude of Mercury 

12061 eraFave03 mean longitude of Venus 

12062 eraFae03 mean longitude of Earth 

12063 eraFama03 mean longitude of Mars 

12064 eraFaju03 mean longitude of Jupiter 

12065 eraFasa03 mean longitude of Saturn 

12066 eraFaur03 mean longitude of Uranus 

12067 eraFane03 mean longitude of Neptune 

12068 eraFapa03 general accumulated precession in longitude 

12069 

12070 References: 

12071 

12072 Capitaine, N., Wallace, P.T. & Chapront, J., 2003, 

12073 Astron.Astrophys., 412, 567 

12074 

12075 Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 

12076 

12077 McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), 

12078 IERS Technical Note No. 32, BKG 

12079 

12080 Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

12081 Francou, G. & Laskar, J., Astron.Astrophys., 1994, 282, 663 

12082 

12083 Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M., 1999, 

12084 Astron.Astrophys.Supp.Ser. 135, 111 

12085 

12086 Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 

12087 

12088 This revision: 2021 May 11 

12089 

12090 Copyright (C) 2013-2021, NumFOCUS Foundation. 

12091 Derived, with permission, from the SOFA library. See notes at end of file. 

12092 

12093 """ 

12094 x, y = ufunc.xy06(date1, date2) 

12095 return x, y 

12096 

12097 

12098def xys00a(date1, date2): 

12099 """ 

12100 For a given TT date, compute the X,Y coordinates of the Celestial 

12101 Intermediate Pole and the CIO locator s, using the IAU 2000A 

12102 precession-nutation model. 

12103 

12104 Parameters 

12105 ---------- 

12106 date1 : double array 

12107 date2 : double array 

12108 

12109 Returns 

12110 ------- 

12111 x : double array 

12112 y : double array 

12113 s : double array 

12114 

12115 Notes 

12116 ----- 

12117 Wraps ERFA function ``eraXys00a``. The ERFA documentation is:: 

12118 

12119 - - - - - - - - - - 

12120 e r a X y s 0 0 a 

12121 - - - - - - - - - - 

12122 

12123 For a given TT date, compute the X,Y coordinates of the Celestial 

12124 Intermediate Pole and the CIO locator s, using the IAU 2000A 

12125 precession-nutation model. 

12126 

12127 Given: 

12128 date1,date2 double TT as a 2-part Julian Date (Note 1) 

12129 

12130 Returned: 

12131 x,y double Celestial Intermediate Pole (Note 2) 

12132 s double the CIO locator s (Note 3) 

12133 

12134 Notes: 

12135 

12136 1) The TT date date1+date2 is a Julian Date, apportioned in any 

12137 convenient way between the two arguments. For example, 

12138 JD(TT)=2450123.7 could be expressed in any of these ways, 

12139 among others: 

12140 

12141 date1 date2 

12142 

12143 2450123.7 0.0 (JD method) 

12144 2451545.0 -1421.3 (J2000 method) 

12145 2400000.5 50123.2 (MJD method) 

12146 2450123.5 0.2 (date & time method) 

12147 

12148 The JD method is the most natural and convenient to use in 

12149 cases where the loss of several decimal digits of resolution 

12150 is acceptable. The J2000 method is best matched to the way 

12151 the argument is handled internally and will deliver the 

12152 optimum resolution. The MJD method and the date & time methods 

12153 are both good compromises between resolution and convenience. 

12154 

12155 2) The Celestial Intermediate Pole coordinates are the x,y 

12156 components of the unit vector in the Geocentric Celestial 

12157 Reference System. 

12158 

12159 3) The CIO locator s (in radians) positions the Celestial 

12160 Intermediate Origin on the equator of the CIP. 

12161 

12162 4) A faster, but slightly less accurate result (about 1 mas for 

12163 X,Y), can be obtained by using instead the eraXys00b function. 

12164 

12165 Called: 

12166 eraPnm00a classical NPB matrix, IAU 2000A 

12167 eraBpn2xy extract CIP X,Y coordinates from NPB matrix 

12168 eraS00 the CIO locator s, given X,Y, IAU 2000A 

12169 

12170 Reference: 

12171 

12172 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

12173 IERS Technical Note No. 32, BKG (2004) 

12174 

12175 This revision: 2021 May 11 

12176 

12177 Copyright (C) 2013-2021, NumFOCUS Foundation. 

12178 Derived, with permission, from the SOFA library. See notes at end of file. 

12179 

12180 """ 

12181 x, y, s = ufunc.xys00a(date1, date2) 

12182 return x, y, s 

12183 

12184 

12185def xys00b(date1, date2): 

12186 """ 

12187 For a given TT date, compute the X,Y coordinates of the Celestial 

12188 Intermediate Pole and the CIO locator s, using the IAU 2000B 

12189 precession-nutation model. 

12190 

12191 Parameters 

12192 ---------- 

12193 date1 : double array 

12194 date2 : double array 

12195 

12196 Returns 

12197 ------- 

12198 x : double array 

12199 y : double array 

12200 s : double array 

12201 

12202 Notes 

12203 ----- 

12204 Wraps ERFA function ``eraXys00b``. The ERFA documentation is:: 

12205 

12206 - - - - - - - - - - 

12207 e r a X y s 0 0 b 

12208 - - - - - - - - - - 

12209 

12210 For a given TT date, compute the X,Y coordinates of the Celestial 

12211 Intermediate Pole and the CIO locator s, using the IAU 2000B 

12212 precession-nutation model. 

12213 

12214 Given: 

12215 date1,date2 double TT as a 2-part Julian Date (Note 1) 

12216 

12217 Returned: 

12218 x,y double Celestial Intermediate Pole (Note 2) 

12219 s double the CIO locator s (Note 3) 

12220 

12221 Notes: 

12222 

12223 1) The TT date date1+date2 is a Julian Date, apportioned in any 

12224 convenient way between the two arguments. For example, 

12225 JD(TT)=2450123.7 could be expressed in any of these ways, 

12226 among others: 

12227 

12228 date1 date2 

12229 

12230 2450123.7 0.0 (JD method) 

12231 2451545.0 -1421.3 (J2000 method) 

12232 2400000.5 50123.2 (MJD method) 

12233 2450123.5 0.2 (date & time method) 

12234 

12235 The JD method is the most natural and convenient to use in 

12236 cases where the loss of several decimal digits of resolution 

12237 is acceptable. The J2000 method is best matched to the way 

12238 the argument is handled internally and will deliver the 

12239 optimum resolution. The MJD method and the date & time methods 

12240 are both good compromises between resolution and convenience. 

12241 

12242 2) The Celestial Intermediate Pole coordinates are the x,y 

12243 components of the unit vector in the Geocentric Celestial 

12244 Reference System. 

12245 

12246 3) The CIO locator s (in radians) positions the Celestial 

12247 Intermediate Origin on the equator of the CIP. 

12248 

12249 4) The present function is faster, but slightly less accurate (about 

12250 1 mas in X,Y), than the eraXys00a function. 

12251 

12252 Called: 

12253 eraPnm00b classical NPB matrix, IAU 2000B 

12254 eraBpn2xy extract CIP X,Y coordinates from NPB matrix 

12255 eraS00 the CIO locator s, given X,Y, IAU 2000A 

12256 

12257 Reference: 

12258 

12259 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

12260 IERS Technical Note No. 32, BKG (2004) 

12261 

12262 This revision: 2021 May 11 

12263 

12264 Copyright (C) 2013-2021, NumFOCUS Foundation. 

12265 Derived, with permission, from the SOFA library. See notes at end of file. 

12266 

12267 """ 

12268 x, y, s = ufunc.xys00b(date1, date2) 

12269 return x, y, s 

12270 

12271 

12272def xys06a(date1, date2): 

12273 """ 

12274 For a given TT date, compute the X,Y coordinates of the Celestial 

12275 Intermediate Pole and the CIO locator s, using the IAU 2006 

12276 precession and IAU 2000A nutation models. 

12277 

12278 Parameters 

12279 ---------- 

12280 date1 : double array 

12281 date2 : double array 

12282 

12283 Returns 

12284 ------- 

12285 x : double array 

12286 y : double array 

12287 s : double array 

12288 

12289 Notes 

12290 ----- 

12291 Wraps ERFA function ``eraXys06a``. The ERFA documentation is:: 

12292 

12293 - - - - - - - - - - 

12294 e r a X y s 0 6 a 

12295 - - - - - - - - - - 

12296 

12297 For a given TT date, compute the X,Y coordinates of the Celestial 

12298 Intermediate Pole and the CIO locator s, using the IAU 2006 

12299 precession and IAU 2000A nutation models. 

12300 

12301 Given: 

12302 date1,date2 double TT as a 2-part Julian Date (Note 1) 

12303 

12304 Returned: 

12305 x,y double Celestial Intermediate Pole (Note 2) 

12306 s double the CIO locator s (Note 3) 

12307 

12308 Notes: 

12309 

12310 1) The TT date date1+date2 is a Julian Date, apportioned in any 

12311 convenient way between the two arguments. For example, 

12312 JD(TT)=2450123.7 could be expressed in any of these ways, 

12313 among others: 

12314 

12315 date1 date2 

12316 

12317 2450123.7 0.0 (JD method) 

12318 2451545.0 -1421.3 (J2000 method) 

12319 2400000.5 50123.2 (MJD method) 

12320 2450123.5 0.2 (date & time method) 

12321 

12322 The JD method is the most natural and convenient to use in 

12323 cases where the loss of several decimal digits of resolution 

12324 is acceptable. The J2000 method is best matched to the way 

12325 the argument is handled internally and will deliver the 

12326 optimum resolution. The MJD method and the date & time methods 

12327 are both good compromises between resolution and convenience. 

12328 

12329 2) The Celestial Intermediate Pole coordinates are the x,y components 

12330 of the unit vector in the Geocentric Celestial Reference System. 

12331 

12332 3) The CIO locator s (in radians) positions the Celestial 

12333 Intermediate Origin on the equator of the CIP. 

12334 

12335 4) Series-based solutions for generating X and Y are also available: 

12336 see Capitaine & Wallace (2006) and eraXy06. 

12337 

12338 Called: 

12339 eraPnm06a classical NPB matrix, IAU 2006/2000A 

12340 eraBpn2xy extract CIP X,Y coordinates from NPB matrix 

12341 eraS06 the CIO locator s, given X,Y, IAU 2006 

12342 

12343 References: 

12344 

12345 Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 

12346 

12347 Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 

12348 

12349 This revision: 2021 May 11 

12350 

12351 Copyright (C) 2013-2021, NumFOCUS Foundation. 

12352 Derived, with permission, from the SOFA library. See notes at end of file. 

12353 

12354 """ 

12355 x, y, s = ufunc.xys06a(date1, date2) 

12356 return x, y, s 

12357 

12358 

12359def ee00(date1, date2, epsa, dpsi): 

12360 """ 

12361 The equation of the equinoxes, compatible with IAU 2000 resolutions, 

12362 given the nutation in longitude and the mean obliquity. 

12363 

12364 Parameters 

12365 ---------- 

12366 date1 : double array 

12367 date2 : double array 

12368 epsa : double array 

12369 dpsi : double array 

12370 

12371 Returns 

12372 ------- 

12373 c_retval : double array 

12374 

12375 Notes 

12376 ----- 

12377 Wraps ERFA function ``eraEe00``. The ERFA documentation is:: 

12378 

12379 - - - - - - - - 

12380 e r a E e 0 0 

12381 - - - - - - - - 

12382 

12383 The equation of the equinoxes, compatible with IAU 2000 resolutions, 

12384 given the nutation in longitude and the mean obliquity. 

12385 

12386 Given: 

12387 date1,date2 double TT as a 2-part Julian Date (Note 1) 

12388 epsa double mean obliquity (Note 2) 

12389 dpsi double nutation in longitude (Note 3) 

12390 

12391 Returned (function value): 

12392 double equation of the equinoxes (Note 4) 

12393 

12394 Notes: 

12395 

12396 1) The TT date date1+date2 is a Julian Date, apportioned in any 

12397 convenient way between the two arguments. For example, 

12398 JD(TT)=2450123.7 could be expressed in any of these ways, 

12399 among others: 

12400 

12401 date1 date2 

12402 

12403 2450123.7 0.0 (JD method) 

12404 2451545.0 -1421.3 (J2000 method) 

12405 2400000.5 50123.2 (MJD method) 

12406 2450123.5 0.2 (date & time method) 

12407 

12408 The JD method is the most natural and convenient to use in 

12409 cases where the loss of several decimal digits of resolution 

12410 is acceptable. The J2000 method is best matched to the way 

12411 the argument is handled internally and will deliver the 

12412 optimum resolution. The MJD method and the date & time methods 

12413 are both good compromises between resolution and convenience. 

12414 

12415 2) The obliquity, in radians, is mean of date. 

12416 

12417 3) The result, which is in radians, operates in the following sense: 

12418 

12419 Greenwich apparent ST = GMST + equation of the equinoxes 

12420 

12421 4) The result is compatible with the IAU 2000 resolutions. For 

12422 further details, see IERS Conventions 2003 and Capitaine et al. 

12423 (2002). 

12424 

12425 Called: 

12426 eraEect00 equation of the equinoxes complementary terms 

12427 

12428 References: 

12429 

12430 Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to 

12431 implement the IAU 2000 definition of UT1", Astronomy & 

12432 Astrophysics, 406, 1135-1149 (2003) 

12433 

12434 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

12435 IERS Technical Note No. 32, BKG (2004) 

12436 

12437 This revision: 2021 May 11 

12438 

12439 Copyright (C) 2013-2021, NumFOCUS Foundation. 

12440 Derived, with permission, from the SOFA library. See notes at end of file. 

12441 

12442 """ 

12443 c_retval = ufunc.ee00(date1, date2, epsa, dpsi) 

12444 return c_retval 

12445 

12446 

12447def ee00a(date1, date2): 

12448 """ 

12449 Equation of the equinoxes, compatible with IAU 2000 resolutions. 

12450 

12451 Parameters 

12452 ---------- 

12453 date1 : double array 

12454 date2 : double array 

12455 

12456 Returns 

12457 ------- 

12458 c_retval : double array 

12459 

12460 Notes 

12461 ----- 

12462 Wraps ERFA function ``eraEe00a``. The ERFA documentation is:: 

12463 

12464 - - - - - - - - - 

12465 e r a E e 0 0 a 

12466 - - - - - - - - - 

12467 

12468 Equation of the equinoxes, compatible with IAU 2000 resolutions. 

12469 

12470 Given: 

12471 date1,date2 double TT as a 2-part Julian Date (Note 1) 

12472 

12473 Returned (function value): 

12474 double equation of the equinoxes (Note 2) 

12475 

12476 Notes: 

12477 

12478 1) The TT date date1+date2 is a Julian Date, apportioned in any 

12479 convenient way between the two arguments. For example, 

12480 JD(TT)=2450123.7 could be expressed in any of these ways, 

12481 among others: 

12482 

12483 date1 date2 

12484 

12485 2450123.7 0.0 (JD method) 

12486 2451545.0 -1421.3 (J2000 method) 

12487 2400000.5 50123.2 (MJD method) 

12488 2450123.5 0.2 (date & time method) 

12489 

12490 The JD method is the most natural and convenient to use in 

12491 cases where the loss of several decimal digits of resolution 

12492 is acceptable. The J2000 method is best matched to the way 

12493 the argument is handled internally and will deliver the 

12494 optimum resolution. The MJD method and the date & time methods 

12495 are both good compromises between resolution and convenience. 

12496 

12497 2) The result, which is in radians, operates in the following sense: 

12498 

12499 Greenwich apparent ST = GMST + equation of the equinoxes 

12500 

12501 3) The result is compatible with the IAU 2000 resolutions. For 

12502 further details, see IERS Conventions 2003 and Capitaine et al. 

12503 (2002). 

12504 

12505 Called: 

12506 eraPr00 IAU 2000 precession adjustments 

12507 eraObl80 mean obliquity, IAU 1980 

12508 eraNut00a nutation, IAU 2000A 

12509 eraEe00 equation of the equinoxes, IAU 2000 

12510 

12511 References: 

12512 

12513 Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to 

12514 implement the IAU 2000 definition of UT1", Astronomy & 

12515 Astrophysics, 406, 1135-1149 (2003). 

12516 

12517 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

12518 IERS Technical Note No. 32, BKG (2004). 

12519 

12520 This revision: 2021 May 11 

12521 

12522 Copyright (C) 2013-2021, NumFOCUS Foundation. 

12523 Derived, with permission, from the SOFA library. See notes at end of file. 

12524 

12525 """ 

12526 c_retval = ufunc.ee00a(date1, date2) 

12527 return c_retval 

12528 

12529 

12530def ee00b(date1, date2): 

12531 """ 

12532 Equation of the equinoxes, compatible with IAU 2000 resolutions but 

12533 using the truncated nutation model IAU 2000B. 

12534 

12535 Parameters 

12536 ---------- 

12537 date1 : double array 

12538 date2 : double array 

12539 

12540 Returns 

12541 ------- 

12542 c_retval : double array 

12543 

12544 Notes 

12545 ----- 

12546 Wraps ERFA function ``eraEe00b``. The ERFA documentation is:: 

12547 

12548 - - - - - - - - - 

12549 e r a E e 0 0 b 

12550 - - - - - - - - - 

12551 

12552 Equation of the equinoxes, compatible with IAU 2000 resolutions but 

12553 using the truncated nutation model IAU 2000B. 

12554 

12555 Given: 

12556 date1,date2 double TT as a 2-part Julian Date (Note 1) 

12557 

12558 Returned (function value): 

12559 double equation of the equinoxes (Note 2) 

12560 

12561 Notes: 

12562 

12563 1) The TT date date1+date2 is a Julian Date, apportioned in any 

12564 convenient way between the two arguments. For example, 

12565 JD(TT)=2450123.7 could be expressed in any of these ways, 

12566 among others: 

12567 

12568 date1 date2 

12569 

12570 2450123.7 0.0 (JD method) 

12571 2451545.0 -1421.3 (J2000 method) 

12572 2400000.5 50123.2 (MJD method) 

12573 2450123.5 0.2 (date & time method) 

12574 

12575 The JD method is the most natural and convenient to use in 

12576 cases where the loss of several decimal digits of resolution 

12577 is acceptable. The J2000 method is best matched to the way 

12578 the argument is handled internally and will deliver the 

12579 optimum resolution. The MJD method and the date & time methods 

12580 are both good compromises between resolution and convenience. 

12581 

12582 2) The result, which is in radians, operates in the following sense: 

12583 

12584 Greenwich apparent ST = GMST + equation of the equinoxes 

12585 

12586 3) The result is compatible with the IAU 2000 resolutions except 

12587 that accuracy has been compromised (1 mas) for the sake of speed. 

12588 For further details, see McCarthy & Luzum (2003), IERS 

12589 Conventions 2003 and Capitaine et al. (2003). 

12590 

12591 Called: 

12592 eraPr00 IAU 2000 precession adjustments 

12593 eraObl80 mean obliquity, IAU 1980 

12594 eraNut00b nutation, IAU 2000B 

12595 eraEe00 equation of the equinoxes, IAU 2000 

12596 

12597 References: 

12598 

12599 Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to 

12600 implement the IAU 2000 definition of UT1", Astronomy & 

12601 Astrophysics, 406, 1135-1149 (2003) 

12602 

12603 McCarthy, D.D. & Luzum, B.J., "An abridged model of the 

12604 precession-nutation of the celestial pole", Celestial Mechanics & 

12605 Dynamical Astronomy, 85, 37-49 (2003) 

12606 

12607 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

12608 IERS Technical Note No. 32, BKG (2004) 

12609 

12610 This revision: 2021 May 11 

12611 

12612 Copyright (C) 2013-2021, NumFOCUS Foundation. 

12613 Derived, with permission, from the SOFA library. See notes at end of file. 

12614 

12615 """ 

12616 c_retval = ufunc.ee00b(date1, date2) 

12617 return c_retval 

12618 

12619 

12620def ee06a(date1, date2): 

12621 """ 

12622 Equation of the equinoxes, compatible with IAU 2000 resolutions and 

12623 IAU 2006/2000A precession-nutation. 

12624 

12625 Parameters 

12626 ---------- 

12627 date1 : double array 

12628 date2 : double array 

12629 

12630 Returns 

12631 ------- 

12632 c_retval : double array 

12633 

12634 Notes 

12635 ----- 

12636 Wraps ERFA function ``eraEe06a``. The ERFA documentation is:: 

12637 

12638 - - - - - - - - - 

12639 e r a E e 0 6 a 

12640 - - - - - - - - - 

12641 

12642 Equation of the equinoxes, compatible with IAU 2000 resolutions and 

12643 IAU 2006/2000A precession-nutation. 

12644 

12645 Given: 

12646 date1,date2 double TT as a 2-part Julian Date (Note 1) 

12647 

12648 Returned (function value): 

12649 double equation of the equinoxes (Note 2) 

12650 

12651 Notes: 

12652 

12653 1) The TT date date1+date2 is a Julian Date, apportioned in any 

12654 convenient way between the two arguments. For example, 

12655 JD(TT)=2450123.7 could be expressed in any of these ways, 

12656 among others: 

12657 

12658 date1 date2 

12659 

12660 2450123.7 0.0 (JD method) 

12661 2451545.0 -1421.3 (J2000 method) 

12662 2400000.5 50123.2 (MJD method) 

12663 2450123.5 0.2 (date & time method) 

12664 

12665 The JD method is the most natural and convenient to use in 

12666 cases where the loss of several decimal digits of resolution 

12667 is acceptable. The J2000 method is best matched to the way 

12668 the argument is handled internally and will deliver the 

12669 optimum resolution. The MJD method and the date & time methods 

12670 are both good compromises between resolution and convenience. 

12671 

12672 2) The result, which is in radians, operates in the following sense: 

12673 

12674 Greenwich apparent ST = GMST + equation of the equinoxes 

12675 

12676 Called: 

12677 eraAnpm normalize angle into range +/- pi 

12678 eraGst06a Greenwich apparent sidereal time, IAU 2006/2000A 

12679 eraGmst06 Greenwich mean sidereal time, IAU 2006 

12680 

12681 Reference: 

12682 

12683 McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), 

12684 IERS Technical Note No. 32, BKG 

12685 

12686 This revision: 2021 May 11 

12687 

12688 Copyright (C) 2013-2021, NumFOCUS Foundation. 

12689 Derived, with permission, from the SOFA library. See notes at end of file. 

12690 

12691 """ 

12692 c_retval = ufunc.ee06a(date1, date2) 

12693 return c_retval 

12694 

12695 

12696def eect00(date1, date2): 

12697 """ 

12698 Equation of the equinoxes complementary terms, consistent with 

12699 IAU 2000 resolutions. 

12700 

12701 Parameters 

12702 ---------- 

12703 date1 : double array 

12704 date2 : double array 

12705 

12706 Returns 

12707 ------- 

12708 c_retval : double array 

12709 

12710 Notes 

12711 ----- 

12712 Wraps ERFA function ``eraEect00``. The ERFA documentation is:: 

12713 

12714 - - - - - - - - - - 

12715 e r a E e c t 0 0 

12716 - - - - - - - - - - 

12717 

12718 Equation of the equinoxes complementary terms, consistent with 

12719 IAU 2000 resolutions. 

12720 

12721 Given: 

12722 date1,date2 double TT as a 2-part Julian Date (Note 1) 

12723 

12724 Returned (function value): 

12725 double complementary terms (Note 2) 

12726 

12727 Notes: 

12728 

12729 1) The TT date date1+date2 is a Julian Date, apportioned in any 

12730 convenient way between the two arguments. For example, 

12731 JD(TT)=2450123.7 could be expressed in any of these ways, 

12732 among others: 

12733 

12734 date1 date2 

12735 

12736 2450123.7 0.0 (JD method) 

12737 2451545.0 -1421.3 (J2000 method) 

12738 2400000.5 50123.2 (MJD method) 

12739 2450123.5 0.2 (date & time method) 

12740 

12741 The JD method is the most natural and convenient to use in 

12742 cases where the loss of several decimal digits of resolution 

12743 is acceptable. The J2000 method is best matched to the way 

12744 the argument is handled internally and will deliver the 

12745 optimum resolution. The MJD method and the date & time methods 

12746 are both good compromises between resolution and convenience. 

12747 

12748 2) The "complementary terms" are part of the equation of the 

12749 equinoxes (EE), classically the difference between apparent and 

12750 mean Sidereal Time: 

12751 

12752 GAST = GMST + EE 

12753 

12754 with: 

12755 

12756 EE = dpsi * cos(eps) 

12757 

12758 where dpsi is the nutation in longitude and eps is the obliquity 

12759 of date. However, if the rotation of the Earth were constant in 

12760 an inertial frame the classical formulation would lead to 

12761 apparent irregularities in the UT1 timescale traceable to side- 

12762 effects of precession-nutation. In order to eliminate these 

12763 effects from UT1, "complementary terms" were introduced in 1994 

12764 (IAU, 1994) and took effect from 1997 (Capitaine and Gontier, 

12765 1993): 

12766 

12767 GAST = GMST + CT + EE 

12768 

12769 By convention, the complementary terms are included as part of 

12770 the equation of the equinoxes rather than as part of the mean 

12771 Sidereal Time. This slightly compromises the "geometrical" 

12772 interpretation of mean sidereal time but is otherwise 

12773 inconsequential. 

12774 

12775 The present function computes CT in the above expression, 

12776 compatible with IAU 2000 resolutions (Capitaine et al., 2002, and 

12777 IERS Conventions 2003). 

12778 

12779 Called: 

12780 eraFal03 mean anomaly of the Moon 

12781 eraFalp03 mean anomaly of the Sun 

12782 eraFaf03 mean argument of the latitude of the Moon 

12783 eraFad03 mean elongation of the Moon from the Sun 

12784 eraFaom03 mean longitude of the Moon's ascending node 

12785 eraFave03 mean longitude of Venus 

12786 eraFae03 mean longitude of Earth 

12787 eraFapa03 general accumulated precession in longitude 

12788 

12789 References: 

12790 

12791 Capitaine, N. & Gontier, A.-M., Astron.Astrophys., 275, 

12792 645-650 (1993) 

12793 

12794 Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to 

12795 implement the IAU 2000 definition of UT1", Astron.Astrophys., 406, 

12796 1135-1149 (2003) 

12797 

12798 IAU Resolution C7, Recommendation 3 (1994) 

12799 

12800 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

12801 IERS Technical Note No. 32, BKG (2004) 

12802 

12803 This revision: 2021 May 11 

12804 

12805 Copyright (C) 2013-2021, NumFOCUS Foundation. 

12806 Derived, with permission, from the SOFA library. See notes at end of file. 

12807 

12808 """ 

12809 c_retval = ufunc.eect00(date1, date2) 

12810 return c_retval 

12811 

12812 

12813def eqeq94(date1, date2): 

12814 """ 

12815 Equation of the equinoxes, IAU 1994 model. 

12816 

12817 Parameters 

12818 ---------- 

12819 date1 : double array 

12820 date2 : double array 

12821 

12822 Returns 

12823 ------- 

12824 c_retval : double array 

12825 

12826 Notes 

12827 ----- 

12828 Wraps ERFA function ``eraEqeq94``. The ERFA documentation is:: 

12829 

12830 - - - - - - - - - - 

12831 e r a E q e q 9 4 

12832 - - - - - - - - - - 

12833 

12834 Equation of the equinoxes, IAU 1994 model. 

12835 

12836 Given: 

12837 date1,date2 double TDB date (Note 1) 

12838 

12839 Returned (function value): 

12840 double equation of the equinoxes (Note 2) 

12841 

12842 Notes: 

12843 

12844 1) The date date1+date2 is a Julian Date, apportioned in any 

12845 convenient way between the two arguments. For example, 

12846 JD(TT)=2450123.7 could be expressed in any of these ways, 

12847 among others: 

12848 

12849 date1 date2 

12850 

12851 2450123.7 0.0 (JD method) 

12852 2451545.0 -1421.3 (J2000 method) 

12853 2400000.5 50123.2 (MJD method) 

12854 2450123.5 0.2 (date & time method) 

12855 

12856 The JD method is the most natural and convenient to use in 

12857 cases where the loss of several decimal digits of resolution 

12858 is acceptable. The J2000 method is best matched to the way 

12859 the argument is handled internally and will deliver the 

12860 optimum resolution. The MJD method and the date & time methods 

12861 are both good compromises between resolution and convenience. 

12862 

12863 2) The result, which is in radians, operates in the following sense: 

12864 

12865 Greenwich apparent ST = GMST + equation of the equinoxes 

12866 

12867 Called: 

12868 eraAnpm normalize angle into range +/- pi 

12869 eraNut80 nutation, IAU 1980 

12870 eraObl80 mean obliquity, IAU 1980 

12871 

12872 References: 

12873 

12874 IAU Resolution C7, Recommendation 3 (1994). 

12875 

12876 Capitaine, N. & Gontier, A.-M., 1993, Astron.Astrophys., 275, 

12877 645-650. 

12878 

12879 This revision: 2021 May 11 

12880 

12881 Copyright (C) 2013-2021, NumFOCUS Foundation. 

12882 Derived, with permission, from the SOFA library. See notes at end of file. 

12883 

12884 """ 

12885 c_retval = ufunc.eqeq94(date1, date2) 

12886 return c_retval 

12887 

12888 

12889def era00(dj1, dj2): 

12890 """ 

12891 Earth rotation angle (IAU 2000 model). 

12892 

12893 Parameters 

12894 ---------- 

12895 dj1 : double array 

12896 dj2 : double array 

12897 

12898 Returns 

12899 ------- 

12900 c_retval : double array 

12901 

12902 Notes 

12903 ----- 

12904 Wraps ERFA function ``eraEra00``. The ERFA documentation is:: 

12905 

12906 - - - - - - - - - 

12907 e r a E r a 0 0 

12908 - - - - - - - - - 

12909 

12910 Earth rotation angle (IAU 2000 model). 

12911 

12912 Given: 

12913 dj1,dj2 double UT1 as a 2-part Julian Date (see note) 

12914 

12915 Returned (function value): 

12916 double Earth rotation angle (radians), range 0-2pi 

12917 

12918 Notes: 

12919 

12920 1) The UT1 date dj1+dj2 is a Julian Date, apportioned in any 

12921 convenient way between the arguments dj1 and dj2. For example, 

12922 JD(UT1)=2450123.7 could be expressed in any of these ways, 

12923 among others: 

12924 

12925 dj1 dj2 

12926 

12927 2450123.7 0.0 (JD method) 

12928 2451545.0 -1421.3 (J2000 method) 

12929 2400000.5 50123.2 (MJD method) 

12930 2450123.5 0.2 (date & time method) 

12931 

12932 The JD method is the most natural and convenient to use in 

12933 cases where the loss of several decimal digits of resolution 

12934 is acceptable. The J2000 and MJD methods are good compromises 

12935 between resolution and convenience. The date & time method is 

12936 best matched to the algorithm used: maximum precision is 

12937 delivered when the dj1 argument is for 0hrs UT1 on the day in 

12938 question and the dj2 argument lies in the range 0 to 1, or vice 

12939 versa. 

12940 

12941 2) The algorithm is adapted from Expression 22 of Capitaine et al. 

12942 2000. The time argument has been expressed in days directly, 

12943 and, to retain precision, integer contributions have been 

12944 eliminated. The same formulation is given in IERS Conventions 

12945 (2003), Chap. 5, Eq. 14. 

12946 

12947 Called: 

12948 eraAnp normalize angle into range 0 to 2pi 

12949 

12950 References: 

12951 

12952 Capitaine N., Guinot B. and McCarthy D.D, 2000, Astron. 

12953 Astrophys., 355, 398-405. 

12954 

12955 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

12956 IERS Technical Note No. 32, BKG (2004) 

12957 

12958 This revision: 2021 May 11 

12959 

12960 Copyright (C) 2013-2021, NumFOCUS Foundation. 

12961 Derived, with permission, from the SOFA library. See notes at end of file. 

12962 

12963 """ 

12964 c_retval = ufunc.era00(dj1, dj2) 

12965 return c_retval 

12966 

12967 

12968def gmst00(uta, utb, tta, ttb): 

12969 """ 

12970 Greenwich mean sidereal time (model consistent with IAU 2000 

12971 resolutions). 

12972 

12973 Parameters 

12974 ---------- 

12975 uta : double array 

12976 utb : double array 

12977 tta : double array 

12978 ttb : double array 

12979 

12980 Returns 

12981 ------- 

12982 c_retval : double array 

12983 

12984 Notes 

12985 ----- 

12986 Wraps ERFA function ``eraGmst00``. The ERFA documentation is:: 

12987 

12988 - - - - - - - - - - 

12989 e r a G m s t 0 0 

12990 - - - - - - - - - - 

12991 

12992 Greenwich mean sidereal time (model consistent with IAU 2000 

12993 resolutions). 

12994 

12995 Given: 

12996 uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) 

12997 tta,ttb double TT as a 2-part Julian Date (Notes 1,2) 

12998 

12999 Returned (function value): 

13000 double Greenwich mean sidereal time (radians) 

13001 

13002 Notes: 

13003 

13004 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both 

13005 Julian Dates, apportioned in any convenient way between the 

13006 argument pairs. For example, JD(UT1)=2450123.7 could be 

13007 expressed in any of these ways, among others: 

13008 

13009 Part A Part B 

13010 

13011 2450123.7 0.0 (JD method) 

13012 2451545.0 -1421.3 (J2000 method) 

13013 2400000.5 50123.2 (MJD method) 

13014 2450123.5 0.2 (date & time method) 

13015 

13016 The JD method is the most natural and convenient to use in 

13017 cases where the loss of several decimal digits of resolution 

13018 is acceptable (in the case of UT; the TT is not at all critical 

13019 in this respect). The J2000 and MJD methods are good compromises 

13020 between resolution and convenience. For UT, the date & time 

13021 method is best matched to the algorithm that is used by the Earth 

13022 Rotation Angle function, called internally: maximum precision is 

13023 delivered when the uta argument is for 0hrs UT1 on the day in 

13024 question and the utb argument lies in the range 0 to 1, or vice 

13025 versa. 

13026 

13027 2) Both UT1 and TT are required, UT1 to predict the Earth rotation 

13028 and TT to predict the effects of precession. If UT1 is used for 

13029 both purposes, errors of order 100 microarcseconds result. 

13030 

13031 3) This GMST is compatible with the IAU 2000 resolutions and must be 

13032 used only in conjunction with other IAU 2000 compatible 

13033 components such as precession-nutation and equation of the 

13034 equinoxes. 

13035 

13036 4) The result is returned in the range 0 to 2pi. 

13037 

13038 5) The algorithm is from Capitaine et al. (2003) and IERS 

13039 Conventions 2003. 

13040 

13041 Called: 

13042 eraEra00 Earth rotation angle, IAU 2000 

13043 eraAnp normalize angle into range 0 to 2pi 

13044 

13045 References: 

13046 

13047 Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to 

13048 implement the IAU 2000 definition of UT1", Astronomy & 

13049 Astrophysics, 406, 1135-1149 (2003) 

13050 

13051 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

13052 IERS Technical Note No. 32, BKG (2004) 

13053 

13054 This revision: 2021 May 11 

13055 

13056 Copyright (C) 2013-2021, NumFOCUS Foundation. 

13057 Derived, with permission, from the SOFA library. See notes at end of file. 

13058 

13059 """ 

13060 c_retval = ufunc.gmst00(uta, utb, tta, ttb) 

13061 return c_retval 

13062 

13063 

13064def gmst06(uta, utb, tta, ttb): 

13065 """ 

13066 Greenwich mean sidereal time (consistent with IAU 2006 precession). 

13067 

13068 Parameters 

13069 ---------- 

13070 uta : double array 

13071 utb : double array 

13072 tta : double array 

13073 ttb : double array 

13074 

13075 Returns 

13076 ------- 

13077 c_retval : double array 

13078 

13079 Notes 

13080 ----- 

13081 Wraps ERFA function ``eraGmst06``. The ERFA documentation is:: 

13082 

13083 - - - - - - - - - - 

13084 e r a G m s t 0 6 

13085 - - - - - - - - - - 

13086 

13087 Greenwich mean sidereal time (consistent with IAU 2006 precession). 

13088 

13089 Given: 

13090 uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) 

13091 tta,ttb double TT as a 2-part Julian Date (Notes 1,2) 

13092 

13093 Returned (function value): 

13094 double Greenwich mean sidereal time (radians) 

13095 

13096 Notes: 

13097 

13098 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both 

13099 Julian Dates, apportioned in any convenient way between the 

13100 argument pairs. For example, JD=2450123.7 could be expressed in 

13101 any of these ways, among others: 

13102 

13103 Part A Part B 

13104 

13105 2450123.7 0.0 (JD method) 

13106 2451545.0 -1421.3 (J2000 method) 

13107 2400000.5 50123.2 (MJD method) 

13108 2450123.5 0.2 (date & time method) 

13109 

13110 The JD method is the most natural and convenient to use in 

13111 cases where the loss of several decimal digits of resolution 

13112 is acceptable (in the case of UT; the TT is not at all critical 

13113 in this respect). The J2000 and MJD methods are good compromises 

13114 between resolution and convenience. For UT, the date & time 

13115 method is best matched to the algorithm that is used by the Earth 

13116 rotation angle function, called internally: maximum precision is 

13117 delivered when the uta argument is for 0hrs UT1 on the day in 

13118 question and the utb argument lies in the range 0 to 1, or vice 

13119 versa. 

13120 

13121 2) Both UT1 and TT are required, UT1 to predict the Earth rotation 

13122 and TT to predict the effects of precession. If UT1 is used for 

13123 both purposes, errors of order 100 microarcseconds result. 

13124 

13125 3) This GMST is compatible with the IAU 2006 precession and must not 

13126 be used with other precession models. 

13127 

13128 4) The result is returned in the range 0 to 2pi. 

13129 

13130 Called: 

13131 eraEra00 Earth rotation angle, IAU 2000 

13132 eraAnp normalize angle into range 0 to 2pi 

13133 

13134 Reference: 

13135 

13136 Capitaine, N., Wallace, P.T. & Chapront, J., 2005, 

13137 Astron.Astrophys. 432, 355 

13138 

13139 This revision: 2021 May 11 

13140 

13141 Copyright (C) 2013-2021, NumFOCUS Foundation. 

13142 Derived, with permission, from the SOFA library. See notes at end of file. 

13143 

13144 """ 

13145 c_retval = ufunc.gmst06(uta, utb, tta, ttb) 

13146 return c_retval 

13147 

13148 

13149def gmst82(dj1, dj2): 

13150 """ 

13151 Universal Time to Greenwich mean sidereal time (IAU 1982 model). 

13152 

13153 Parameters 

13154 ---------- 

13155 dj1 : double array 

13156 dj2 : double array 

13157 

13158 Returns 

13159 ------- 

13160 c_retval : double array 

13161 

13162 Notes 

13163 ----- 

13164 Wraps ERFA function ``eraGmst82``. The ERFA documentation is:: 

13165 

13166 - - - - - - - - - - 

13167 e r a G m s t 8 2 

13168 - - - - - - - - - - 

13169 

13170 Universal Time to Greenwich mean sidereal time (IAU 1982 model). 

13171 

13172 Given: 

13173 dj1,dj2 double UT1 Julian Date (see note) 

13174 

13175 Returned (function value): 

13176 double Greenwich mean sidereal time (radians) 

13177 

13178 Notes: 

13179 

13180 1) The UT1 date dj1+dj2 is a Julian Date, apportioned in any 

13181 convenient way between the arguments dj1 and dj2. For example, 

13182 JD(UT1)=2450123.7 could be expressed in any of these ways, 

13183 among others: 

13184 

13185 dj1 dj2 

13186 

13187 2450123.7 0 (JD method) 

13188 2451545 -1421.3 (J2000 method) 

13189 2400000.5 50123.2 (MJD method) 

13190 2450123.5 0.2 (date & time method) 

13191 

13192 The JD method is the most natural and convenient to use in 

13193 cases where the loss of several decimal digits of resolution 

13194 is acceptable. The J2000 and MJD methods are good compromises 

13195 between resolution and convenience. The date & time method is 

13196 best matched to the algorithm used: maximum accuracy (or, at 

13197 least, minimum noise) is delivered when the dj1 argument is for 

13198 0hrs UT1 on the day in question and the dj2 argument lies in the 

13199 range 0 to 1, or vice versa. 

13200 

13201 2) The algorithm is based on the IAU 1982 expression. This is 

13202 always described as giving the GMST at 0 hours UT1. In fact, it 

13203 gives the difference between the GMST and the UT, the steady 

13204 4-minutes-per-day drawing-ahead of ST with respect to UT. When 

13205 whole days are ignored, the expression happens to equal the GMST 

13206 at 0 hours UT1 each day. 

13207 

13208 3) In this function, the entire UT1 (the sum of the two arguments 

13209 dj1 and dj2) is used directly as the argument for the standard 

13210 formula, the constant term of which is adjusted by 12 hours to 

13211 take account of the noon phasing of Julian Date. The UT1 is then 

13212 added, but omitting whole days to conserve accuracy. 

13213 

13214 Called: 

13215 eraAnp normalize angle into range 0 to 2pi 

13216 

13217 References: 

13218 

13219 Transactions of the International Astronomical Union, 

13220 XVIII B, 67 (1983). 

13221 

13222 Aoki et al., Astron.Astrophys., 105, 359-361 (1982). 

13223 

13224 This revision: 2021 May 11 

13225 

13226 Copyright (C) 2013-2021, NumFOCUS Foundation. 

13227 Derived, with permission, from the SOFA library. See notes at end of file. 

13228 

13229 """ 

13230 c_retval = ufunc.gmst82(dj1, dj2) 

13231 return c_retval 

13232 

13233 

13234def gst00a(uta, utb, tta, ttb): 

13235 """ 

13236 Greenwich apparent sidereal time (consistent with IAU 2000 

13237 resolutions). 

13238 

13239 Parameters 

13240 ---------- 

13241 uta : double array 

13242 utb : double array 

13243 tta : double array 

13244 ttb : double array 

13245 

13246 Returns 

13247 ------- 

13248 c_retval : double array 

13249 

13250 Notes 

13251 ----- 

13252 Wraps ERFA function ``eraGst00a``. The ERFA documentation is:: 

13253 

13254 - - - - - - - - - - 

13255 e r a G s t 0 0 a 

13256 - - - - - - - - - - 

13257 

13258 Greenwich apparent sidereal time (consistent with IAU 2000 

13259 resolutions). 

13260 

13261 Given: 

13262 uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) 

13263 tta,ttb double TT as a 2-part Julian Date (Notes 1,2) 

13264 

13265 Returned (function value): 

13266 double Greenwich apparent sidereal time (radians) 

13267 

13268 Notes: 

13269 

13270 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both 

13271 Julian Dates, apportioned in any convenient way between the 

13272 argument pairs. For example, JD(UT1)=2450123.7 could be 

13273 expressed in any of these ways, among others: 

13274 

13275 uta utb 

13276 

13277 2450123.7 0.0 (JD method) 

13278 2451545.0 -1421.3 (J2000 method) 

13279 2400000.5 50123.2 (MJD method) 

13280 2450123.5 0.2 (date & time method) 

13281 

13282 The JD method is the most natural and convenient to use in 

13283 cases where the loss of several decimal digits of resolution 

13284 is acceptable (in the case of UT; the TT is not at all critical 

13285 in this respect). The J2000 and MJD methods are good compromises 

13286 between resolution and convenience. For UT, the date & time 

13287 method is best matched to the algorithm that is used by the Earth 

13288 Rotation Angle function, called internally: maximum precision is 

13289 delivered when the uta argument is for 0hrs UT1 on the day in 

13290 question and the utb argument lies in the range 0 to 1, or vice 

13291 versa. 

13292 

13293 2) Both UT1 and TT are required, UT1 to predict the Earth rotation 

13294 and TT to predict the effects of precession-nutation. If UT1 is 

13295 used for both purposes, errors of order 100 microarcseconds 

13296 result. 

13297 

13298 3) This GAST is compatible with the IAU 2000 resolutions and must be 

13299 used only in conjunction with other IAU 2000 compatible 

13300 components such as precession-nutation. 

13301 

13302 4) The result is returned in the range 0 to 2pi. 

13303 

13304 5) The algorithm is from Capitaine et al. (2003) and IERS 

13305 Conventions 2003. 

13306 

13307 Called: 

13308 eraGmst00 Greenwich mean sidereal time, IAU 2000 

13309 eraEe00a equation of the equinoxes, IAU 2000A 

13310 eraAnp normalize angle into range 0 to 2pi 

13311 

13312 References: 

13313 

13314 Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to 

13315 implement the IAU 2000 definition of UT1", Astronomy & 

13316 Astrophysics, 406, 1135-1149 (2003) 

13317 

13318 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

13319 IERS Technical Note No. 32, BKG (2004) 

13320 

13321 This revision: 2021 May 11 

13322 

13323 Copyright (C) 2013-2021, NumFOCUS Foundation. 

13324 Derived, with permission, from the SOFA library. See notes at end of file. 

13325 

13326 """ 

13327 c_retval = ufunc.gst00a(uta, utb, tta, ttb) 

13328 return c_retval 

13329 

13330 

13331def gst00b(uta, utb): 

13332 """ 

13333 Greenwich apparent sidereal time (consistent with IAU 2000 

13334 resolutions but using the truncated nutation model IAU 2000B). 

13335 

13336 Parameters 

13337 ---------- 

13338 uta : double array 

13339 utb : double array 

13340 

13341 Returns 

13342 ------- 

13343 c_retval : double array 

13344 

13345 Notes 

13346 ----- 

13347 Wraps ERFA function ``eraGst00b``. The ERFA documentation is:: 

13348 

13349 - - - - - - - - - - 

13350 e r a G s t 0 0 b 

13351 - - - - - - - - - - 

13352 

13353 Greenwich apparent sidereal time (consistent with IAU 2000 

13354 resolutions but using the truncated nutation model IAU 2000B). 

13355 

13356 Given: 

13357 uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) 

13358 

13359 Returned (function value): 

13360 double Greenwich apparent sidereal time (radians) 

13361 

13362 Notes: 

13363 

13364 1) The UT1 date uta+utb is a Julian Date, apportioned in any 

13365 convenient way between the argument pair. For example, 

13366 JD(UT1)=2450123.7 could be expressed in any of these ways, 

13367 among others: 

13368 

13369 uta utb 

13370 

13371 2450123.7 0.0 (JD method) 

13372 2451545.0 -1421.3 (J2000 method) 

13373 2400000.5 50123.2 (MJD method) 

13374 2450123.5 0.2 (date & time method) 

13375 

13376 The JD method is the most natural and convenient to use in cases 

13377 where the loss of several decimal digits of resolution is 

13378 acceptable. The J2000 and MJD methods are good compromises 

13379 between resolution and convenience. For UT, the date & time 

13380 method is best matched to the algorithm that is used by the Earth 

13381 Rotation Angle function, called internally: maximum precision is 

13382 delivered when the uta argument is for 0hrs UT1 on the day in 

13383 question and the utb argument lies in the range 0 to 1, or vice 

13384 versa. 

13385 

13386 2) The result is compatible with the IAU 2000 resolutions, except 

13387 that accuracy has been compromised for the sake of speed and 

13388 convenience in two respects: 

13389 

13390 . UT is used instead of TDB (or TT) to compute the precession 

13391 component of GMST and the equation of the equinoxes. This 

13392 results in errors of order 0.1 mas at present. 

13393 

13394 . The IAU 2000B abridged nutation model (McCarthy & Luzum, 2003) 

13395 is used, introducing errors of up to 1 mas. 

13396 

13397 3) This GAST is compatible with the IAU 2000 resolutions and must be 

13398 used only in conjunction with other IAU 2000 compatible 

13399 components such as precession-nutation. 

13400 

13401 4) The result is returned in the range 0 to 2pi. 

13402 

13403 5) The algorithm is from Capitaine et al. (2003) and IERS 

13404 Conventions 2003. 

13405 

13406 Called: 

13407 eraGmst00 Greenwich mean sidereal time, IAU 2000 

13408 eraEe00b equation of the equinoxes, IAU 2000B 

13409 eraAnp normalize angle into range 0 to 2pi 

13410 

13411 References: 

13412 

13413 Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to 

13414 implement the IAU 2000 definition of UT1", Astronomy & 

13415 Astrophysics, 406, 1135-1149 (2003) 

13416 

13417 McCarthy, D.D. & Luzum, B.J., "An abridged model of the 

13418 precession-nutation of the celestial pole", Celestial Mechanics & 

13419 Dynamical Astronomy, 85, 37-49 (2003) 

13420 

13421 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

13422 IERS Technical Note No. 32, BKG (2004) 

13423 

13424 This revision: 2021 May 11 

13425 

13426 Copyright (C) 2013-2021, NumFOCUS Foundation. 

13427 Derived, with permission, from the SOFA library. See notes at end of file. 

13428 

13429 """ 

13430 c_retval = ufunc.gst00b(uta, utb) 

13431 return c_retval 

13432 

13433 

13434def gst06(uta, utb, tta, ttb, rnpb): 

13435 """ 

13436 Greenwich apparent sidereal time, IAU 2006, given the NPB matrix. 

13437 

13438 Parameters 

13439 ---------- 

13440 uta : double array 

13441 utb : double array 

13442 tta : double array 

13443 ttb : double array 

13444 rnpb : double array 

13445 

13446 Returns 

13447 ------- 

13448 c_retval : double array 

13449 

13450 Notes 

13451 ----- 

13452 Wraps ERFA function ``eraGst06``. The ERFA documentation is:: 

13453 

13454 - - - - - - - - - 

13455 e r a G s t 0 6 

13456 - - - - - - - - - 

13457 

13458 Greenwich apparent sidereal time, IAU 2006, given the NPB matrix. 

13459 

13460 Given: 

13461 uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) 

13462 tta,ttb double TT as a 2-part Julian Date (Notes 1,2) 

13463 rnpb double[3][3] nutation x precession x bias matrix 

13464 

13465 Returned (function value): 

13466 double Greenwich apparent sidereal time (radians) 

13467 

13468 Notes: 

13469 

13470 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both 

13471 Julian Dates, apportioned in any convenient way between the 

13472 argument pairs. For example, JD(UT1)=2450123.7 could be 

13473 expressed in any of these ways, among others: 

13474 

13475 uta utb 

13476 

13477 2450123.7 0.0 (JD method) 

13478 2451545.0 -1421.3 (J2000 method) 

13479 2400000.5 50123.2 (MJD method) 

13480 2450123.5 0.2 (date & time method) 

13481 

13482 The JD method is the most natural and convenient to use in 

13483 cases where the loss of several decimal digits of resolution 

13484 is acceptable (in the case of UT; the TT is not at all critical 

13485 in this respect). The J2000 and MJD methods are good compromises 

13486 between resolution and convenience. For UT, the date & time 

13487 method is best matched to the algorithm that is used by the Earth 

13488 rotation angle function, called internally: maximum precision is 

13489 delivered when the uta argument is for 0hrs UT1 on the day in 

13490 question and the utb argument lies in the range 0 to 1, or vice 

13491 versa. 

13492 

13493 2) Both UT1 and TT are required, UT1 to predict the Earth rotation 

13494 and TT to predict the effects of precession-nutation. If UT1 is 

13495 used for both purposes, errors of order 100 microarcseconds 

13496 result. 

13497 

13498 3) Although the function uses the IAU 2006 series for s+XY/2, it is 

13499 otherwise independent of the precession-nutation model and can in 

13500 practice be used with any equinox-based NPB matrix. 

13501 

13502 4) The result is returned in the range 0 to 2pi. 

13503 

13504 Called: 

13505 eraBpn2xy extract CIP X,Y coordinates from NPB matrix 

13506 eraS06 the CIO locator s, given X,Y, IAU 2006 

13507 eraAnp normalize angle into range 0 to 2pi 

13508 eraEra00 Earth rotation angle, IAU 2000 

13509 eraEors equation of the origins, given NPB matrix and s 

13510 

13511 Reference: 

13512 

13513 Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 

13514 

13515 This revision: 2021 May 11 

13516 

13517 Copyright (C) 2013-2021, NumFOCUS Foundation. 

13518 Derived, with permission, from the SOFA library. See notes at end of file. 

13519 

13520 """ 

13521 c_retval = ufunc.gst06(uta, utb, tta, ttb, rnpb) 

13522 return c_retval 

13523 

13524 

13525def gst06a(uta, utb, tta, ttb): 

13526 """ 

13527 Greenwich apparent sidereal time (consistent with IAU 2000 and 2006 

13528 resolutions). 

13529 

13530 Parameters 

13531 ---------- 

13532 uta : double array 

13533 utb : double array 

13534 tta : double array 

13535 ttb : double array 

13536 

13537 Returns 

13538 ------- 

13539 c_retval : double array 

13540 

13541 Notes 

13542 ----- 

13543 Wraps ERFA function ``eraGst06a``. The ERFA documentation is:: 

13544 

13545 - - - - - - - - - - 

13546 e r a G s t 0 6 a 

13547 - - - - - - - - - - 

13548 

13549 Greenwich apparent sidereal time (consistent with IAU 2000 and 2006 

13550 resolutions). 

13551 

13552 Given: 

13553 uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) 

13554 tta,ttb double TT as a 2-part Julian Date (Notes 1,2) 

13555 

13556 Returned (function value): 

13557 double Greenwich apparent sidereal time (radians) 

13558 

13559 Notes: 

13560 

13561 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both 

13562 Julian Dates, apportioned in any convenient way between the 

13563 argument pairs. For example, JD(UT1)=2450123.7 could be 

13564 expressed in any of these ways, among others: 

13565 

13566 uta utb 

13567 

13568 2450123.7 0.0 (JD method) 

13569 2451545.0 -1421.3 (J2000 method) 

13570 2400000.5 50123.2 (MJD method) 

13571 2450123.5 0.2 (date & time method) 

13572 

13573 The JD method is the most natural and convenient to use in 

13574 cases where the loss of several decimal digits of resolution 

13575 is acceptable (in the case of UT; the TT is not at all critical 

13576 in this respect). The J2000 and MJD methods are good compromises 

13577 between resolution and convenience. For UT, the date & time 

13578 method is best matched to the algorithm that is used by the Earth 

13579 rotation angle function, called internally: maximum precision is 

13580 delivered when the uta argument is for 0hrs UT1 on the day in 

13581 question and the utb argument lies in the range 0 to 1, or vice 

13582 versa. 

13583 

13584 2) Both UT1 and TT are required, UT1 to predict the Earth rotation 

13585 and TT to predict the effects of precession-nutation. If UT1 is 

13586 used for both purposes, errors of order 100 microarcseconds 

13587 result. 

13588 

13589 3) This GAST is compatible with the IAU 2000/2006 resolutions and 

13590 must be used only in conjunction with IAU 2006 precession and 

13591 IAU 2000A nutation. 

13592 

13593 4) The result is returned in the range 0 to 2pi. 

13594 

13595 Called: 

13596 eraPnm06a classical NPB matrix, IAU 2006/2000A 

13597 eraGst06 Greenwich apparent ST, IAU 2006, given NPB matrix 

13598 

13599 Reference: 

13600 

13601 Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 

13602 

13603 This revision: 2021 May 11 

13604 

13605 Copyright (C) 2013-2021, NumFOCUS Foundation. 

13606 Derived, with permission, from the SOFA library. See notes at end of file. 

13607 

13608 """ 

13609 c_retval = ufunc.gst06a(uta, utb, tta, ttb) 

13610 return c_retval 

13611 

13612 

13613def gst94(uta, utb): 

13614 """ 

13615 Greenwich apparent sidereal time (consistent with IAU 1982/94 

13616 resolutions). 

13617 

13618 Parameters 

13619 ---------- 

13620 uta : double array 

13621 utb : double array 

13622 

13623 Returns 

13624 ------- 

13625 c_retval : double array 

13626 

13627 Notes 

13628 ----- 

13629 Wraps ERFA function ``eraGst94``. The ERFA documentation is:: 

13630 

13631 - - - - - - - - - 

13632 e r a G s t 9 4 

13633 - - - - - - - - - 

13634 

13635 Greenwich apparent sidereal time (consistent with IAU 1982/94 

13636 resolutions). 

13637 

13638 Given: 

13639 uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) 

13640 

13641 Returned (function value): 

13642 double Greenwich apparent sidereal time (radians) 

13643 

13644 Notes: 

13645 

13646 1) The UT1 date uta+utb is a Julian Date, apportioned in any 

13647 convenient way between the argument pair. For example, 

13648 JD(UT1)=2450123.7 could be expressed in any of these ways, among 

13649 others: 

13650 

13651 uta utb 

13652 

13653 2450123.7 0.0 (JD method) 

13654 2451545.0 -1421.3 (J2000 method) 

13655 2400000.5 50123.2 (MJD method) 

13656 2450123.5 0.2 (date & time method) 

13657 

13658 The JD method is the most natural and convenient to use in cases 

13659 where the loss of several decimal digits of resolution is 

13660 acceptable. The J2000 and MJD methods are good compromises 

13661 between resolution and convenience. For UT, the date & time 

13662 method is best matched to the algorithm that is used by the Earth 

13663 Rotation Angle function, called internally: maximum precision is 

13664 delivered when the uta argument is for 0hrs UT1 on the day in 

13665 question and the utb argument lies in the range 0 to 1, or vice 

13666 versa. 

13667 

13668 2) The result is compatible with the IAU 1982 and 1994 resolutions, 

13669 except that accuracy has been compromised for the sake of 

13670 convenience in that UT is used instead of TDB (or TT) to compute 

13671 the equation of the equinoxes. 

13672 

13673 3) This GAST must be used only in conjunction with contemporaneous 

13674 IAU standards such as 1976 precession, 1980 obliquity and 1982 

13675 nutation. It is not compatible with the IAU 2000 resolutions. 

13676 

13677 4) The result is returned in the range 0 to 2pi. 

13678 

13679 Called: 

13680 eraGmst82 Greenwich mean sidereal time, IAU 1982 

13681 eraEqeq94 equation of the equinoxes, IAU 1994 

13682 eraAnp normalize angle into range 0 to 2pi 

13683 

13684 References: 

13685 

13686 Explanatory Supplement to the Astronomical Almanac, 

13687 P. Kenneth Seidelmann (ed), University Science Books (1992) 

13688 

13689 IAU Resolution C7, Recommendation 3 (1994) 

13690 

13691 This revision: 2021 May 11 

13692 

13693 Copyright (C) 2013-2021, NumFOCUS Foundation. 

13694 Derived, with permission, from the SOFA library. See notes at end of file. 

13695 

13696 """ 

13697 c_retval = ufunc.gst94(uta, utb) 

13698 return c_retval 

13699 

13700 

13701def pvstar(pv): 

13702 """ 

13703 Convert star position+velocity vector to catalog coordinates. 

13704 

13705 Parameters 

13706 ---------- 

13707 pv : double array 

13708 

13709 Returns 

13710 ------- 

13711 ra : double array 

13712 dec : double array 

13713 pmr : double array 

13714 pmd : double array 

13715 px : double array 

13716 rv : double array 

13717 

13718 Notes 

13719 ----- 

13720 Wraps ERFA function ``eraPvstar``. The ERFA documentation is:: 

13721 

13722 - - - - - - - - - - 

13723 e r a P v s t a r 

13724 - - - - - - - - - - 

13725 

13726 Convert star position+velocity vector to catalog coordinates. 

13727 

13728 Given (Note 1): 

13729 pv double[2][3] pv-vector (au, au/day) 

13730 

13731 Returned (Note 2): 

13732 ra double right ascension (radians) 

13733 dec double declination (radians) 

13734 pmr double RA proper motion (radians/year) 

13735 pmd double Dec proper motion (radians/year) 

13736 px double parallax (arcsec) 

13737 rv double radial velocity (km/s, positive = receding) 

13738 

13739 Returned (function value): 

13740 int status: 

13741 0 = OK 

13742 -1 = superluminal speed (Note 5) 

13743 -2 = null position vector 

13744 

13745 Notes: 

13746 

13747 1) The specified pv-vector is the coordinate direction (and its rate 

13748 of change) for the date at which the light leaving the star 

13749 reached the solar-system barycenter. 

13750 

13751 2) The star data returned by this function are "observables" for an 

13752 imaginary observer at the solar-system barycenter. Proper motion 

13753 and radial velocity are, strictly, in terms of barycentric 

13754 coordinate time, TCB. For most practical applications, it is 

13755 permissible to neglect the distinction between TCB and ordinary 

13756 "proper" time on Earth (TT/TAI). The result will, as a rule, be 

13757 limited by the intrinsic accuracy of the proper-motion and 

13758 radial-velocity data; moreover, the supplied pv-vector is likely 

13759 to be merely an intermediate result (for example generated by the 

13760 function eraStarpv), so that a change of time unit will cancel 

13761 out overall. 

13762 

13763 In accordance with normal star-catalog conventions, the object's 

13764 right ascension and declination are freed from the effects of 

13765 secular aberration. The frame, which is aligned to the catalog 

13766 equator and equinox, is Lorentzian and centered on the SSB. 

13767 

13768 Summarizing, the specified pv-vector is for most stars almost 

13769 identical to the result of applying the standard geometrical 

13770 "space motion" transformation to the catalog data. The 

13771 differences, which are the subject of the Stumpff paper cited 

13772 below, are: 

13773 

13774 (i) In stars with significant radial velocity and proper motion, 

13775 the constantly changing light-time distorts the apparent proper 

13776 motion. Note that this is a classical, not a relativistic, 

13777 effect. 

13778 

13779 (ii) The transformation complies with special relativity. 

13780 

13781 3) Care is needed with units. The star coordinates are in radians 

13782 and the proper motions in radians per Julian year, but the 

13783 parallax is in arcseconds; the radial velocity is in km/s, but 

13784 the pv-vector result is in au and au/day. 

13785 

13786 4) The proper motions are the rate of change of the right ascension 

13787 and declination at the catalog epoch and are in radians per Julian 

13788 year. The RA proper motion is in terms of coordinate angle, not 

13789 true angle, and will thus be numerically larger at high 

13790 declinations. 

13791 

13792 5) Straight-line motion at constant speed in the inertial frame is 

13793 assumed. If the speed is greater than or equal to the speed of 

13794 light, the function aborts with an error status. 

13795 

13796 6) The inverse transformation is performed by the function eraStarpv. 

13797 

13798 Called: 

13799 eraPn decompose p-vector into modulus and direction 

13800 eraPdp scalar product of two p-vectors 

13801 eraSxp multiply p-vector by scalar 

13802 eraPmp p-vector minus p-vector 

13803 eraPm modulus of p-vector 

13804 eraPpp p-vector plus p-vector 

13805 eraPv2s pv-vector to spherical 

13806 eraAnp normalize angle into range 0 to 2pi 

13807 

13808 Reference: 

13809 

13810 Stumpff, P., 1985, Astron.Astrophys. 144, 232-240. 

13811 

13812 This revision: 2021 May 11 

13813 

13814 Copyright (C) 2013-2021, NumFOCUS Foundation. 

13815 Derived, with permission, from the SOFA library. See notes at end of file. 

13816 

13817 """ 

13818 ra, dec, pmr, pmd, px, rv, c_retval = ufunc.pvstar(pv) 

13819 check_errwarn(c_retval, 'pvstar') 

13820 return ra, dec, pmr, pmd, px, rv 

13821 

13822 

13823STATUS_CODES['pvstar'] = { 

13824 0: 'OK', 

13825 -1: 'superluminal speed (Note 5)', 

13826 -2: 'null position vector', 

13827} 

13828 

13829 

13830def starpv(ra, dec, pmr, pmd, px, rv): 

13831 """ 

13832 Convert star catalog coordinates to position+velocity vector. 

13833 

13834 Parameters 

13835 ---------- 

13836 ra : double array 

13837 dec : double array 

13838 pmr : double array 

13839 pmd : double array 

13840 px : double array 

13841 rv : double array 

13842 

13843 Returns 

13844 ------- 

13845 pv : double array 

13846 

13847 Notes 

13848 ----- 

13849 Wraps ERFA function ``eraStarpv``. The ERFA documentation is:: 

13850 

13851 - - - - - - - - - - 

13852 e r a S t a r p v 

13853 - - - - - - - - - - 

13854 

13855 Convert star catalog coordinates to position+velocity vector. 

13856 

13857 Given (Note 1): 

13858 ra double right ascension (radians) 

13859 dec double declination (radians) 

13860 pmr double RA proper motion (radians/year) 

13861 pmd double Dec proper motion (radians/year) 

13862 px double parallax (arcseconds) 

13863 rv double radial velocity (km/s, positive = receding) 

13864 

13865 Returned (Note 2): 

13866 pv double[2][3] pv-vector (au, au/day) 

13867 

13868 Returned (function value): 

13869 int status: 

13870 0 = no warnings 

13871 1 = distance overridden (Note 6) 

13872 2 = excessive speed (Note 7) 

13873 4 = solution didn't converge (Note 8) 

13874 else = binary logical OR of the above 

13875 

13876 Notes: 

13877 

13878 1) The star data accepted by this function are "observables" for an 

13879 imaginary observer at the solar-system barycenter. Proper motion 

13880 and radial velocity are, strictly, in terms of barycentric 

13881 coordinate time, TCB. For most practical applications, it is 

13882 permissible to neglect the distinction between TCB and ordinary 

13883 "proper" time on Earth (TT/TAI). The result will, as a rule, be 

13884 limited by the intrinsic accuracy of the proper-motion and 

13885 radial-velocity data; moreover, the pv-vector is likely to be 

13886 merely an intermediate result, so that a change of time unit 

13887 would cancel out overall. 

13888 

13889 In accordance with normal star-catalog conventions, the object's 

13890 right ascension and declination are freed from the effects of 

13891 secular aberration. The frame, which is aligned to the catalog 

13892 equator and equinox, is Lorentzian and centered on the SSB. 

13893 

13894 2) The resulting position and velocity pv-vector is with respect to 

13895 the same frame and, like the catalog coordinates, is freed from 

13896 the effects of secular aberration. Should the "coordinate 

13897 direction", where the object was located at the catalog epoch, be 

13898 required, it may be obtained by calculating the magnitude of the 

13899 position vector pv[0][0-2] dividing by the speed of light in 

13900 au/day to give the light-time, and then multiplying the space 

13901 velocity pv[1][0-2] by this light-time and adding the result to 

13902 pv[0][0-2]. 

13903 

13904 Summarizing, the pv-vector returned is for most stars almost 

13905 identical to the result of applying the standard geometrical 

13906 "space motion" transformation. The differences, which are the 

13907 subject of the Stumpff paper referenced below, are: 

13908 

13909 (i) In stars with significant radial velocity and proper motion, 

13910 the constantly changing light-time distorts the apparent proper 

13911 motion. Note that this is a classical, not a relativistic, 

13912 effect. 

13913 

13914 (ii) The transformation complies with special relativity. 

13915 

13916 3) Care is needed with units. The star coordinates are in radians 

13917 and the proper motions in radians per Julian year, but the 

13918 parallax is in arcseconds; the radial velocity is in km/s, but 

13919 the pv-vector result is in au and au/day. 

13920 

13921 4) The RA proper motion is in terms of coordinate angle, not true 

13922 angle. If the catalog uses arcseconds for both RA and Dec proper 

13923 motions, the RA proper motion will need to be divided by cos(Dec) 

13924 before use. 

13925 

13926 5) Straight-line motion at constant speed, in the inertial frame, 

13927 is assumed. 

13928 

13929 6) An extremely small (or zero or negative) parallax is interpreted 

13930 to mean that the object is on the "celestial sphere", the radius 

13931 of which is an arbitrary (large) value (see the constant PXMIN). 

13932 When the distance is overridden in this way, the status, 

13933 initially zero, has 1 added to it. 

13934 

13935 7) If the space velocity is a significant fraction of c (see the 

13936 constant VMAX), it is arbitrarily set to zero. When this action 

13937 occurs, 2 is added to the status. 

13938 

13939 8) The relativistic adjustment involves an iterative calculation. 

13940 If the process fails to converge within a set number (IMAX) of 

13941 iterations, 4 is added to the status. 

13942 

13943 9) The inverse transformation is performed by the function 

13944 eraPvstar. 

13945 

13946 Called: 

13947 eraS2pv spherical coordinates to pv-vector 

13948 eraPm modulus of p-vector 

13949 eraZp zero p-vector 

13950 eraPn decompose p-vector into modulus and direction 

13951 eraPdp scalar product of two p-vectors 

13952 eraSxp multiply p-vector by scalar 

13953 eraPmp p-vector minus p-vector 

13954 eraPpp p-vector plus p-vector 

13955 

13956 Reference: 

13957 

13958 Stumpff, P., 1985, Astron.Astrophys. 144, 232-240. 

13959 

13960 This revision: 2021 May 11 

13961 

13962 Copyright (C) 2013-2021, NumFOCUS Foundation. 

13963 Derived, with permission, from the SOFA library. See notes at end of file. 

13964 

13965 """ 

13966 pv, c_retval = ufunc.starpv(ra, dec, pmr, pmd, px, rv) 

13967 check_errwarn(c_retval, 'starpv') 

13968 return pv 

13969 

13970 

13971STATUS_CODES['starpv'] = { 

13972 0: 'no warnings', 

13973 1: 'distance overridden (Note 6)', 

13974 2: 'excessive speed (Note 7)', 

13975 4: "solution didn't converge (Note 8)", 

13976 'else': 'binary logical OR of the above', 

13977} 

13978 

13979 

13980def fk425(r1950, d1950, dr1950, dd1950, p1950, v1950): 

13981 """ 

13982 Convert B1950.0 FK4 star catalog data to J2000.0 FK5. 

13983 

13984 Parameters 

13985 ---------- 

13986 r1950 : double array 

13987 d1950 : double array 

13988 dr1950 : double array 

13989 dd1950 : double array 

13990 p1950 : double array 

13991 v1950 : double array 

13992 

13993 Returns 

13994 ------- 

13995 r2000 : double array 

13996 d2000 : double array 

13997 dr2000 : double array 

13998 dd2000 : double array 

13999 p2000 : double array 

14000 v2000 : double array 

14001 

14002 Notes 

14003 ----- 

14004 Wraps ERFA function ``eraFk425``. The ERFA documentation is:: 

14005 

14006 - - - - - - - - - 

14007 e r a F k 4 2 5 

14008 - - - - - - - - - 

14009 

14010 Convert B1950.0 FK4 star catalog data to J2000.0 FK5. 

14011 

14012 This function converts a star's catalog data from the old FK4 

14013 (Bessel-Newcomb) system to the later IAU 1976 FK5 (Fricke) system. 

14014 

14015 Given: (all B1950.0, FK4) 

14016 r1950,d1950 double B1950.0 RA,Dec (rad) 

14017 dr1950,dd1950 double B1950.0 proper motions (rad/trop.yr) 

14018 p1950 double parallax (arcsec) 

14019 v1950 double radial velocity (km/s, +ve = moving away) 

14020 

14021 Returned: (all J2000.0, FK5) 

14022 r2000,d2000 double J2000.0 RA,Dec (rad) 

14023 dr2000,dd2000 double J2000.0 proper motions (rad/Jul.yr) 

14024 p2000 double parallax (arcsec) 

14025 v2000 double radial velocity (km/s, +ve = moving away) 

14026 

14027 Notes: 

14028 

14029 1) The proper motions in RA are dRA/dt rather than cos(Dec)*dRA/dt, 

14030 and are per year rather than per century. 

14031 

14032 2) The conversion is somewhat complicated, for several reasons: 

14033 

14034 . Change of standard epoch from B1950.0 to J2000.0. 

14035 

14036 . An intermediate transition date of 1984 January 1.0 TT. 

14037 

14038 . A change of precession model. 

14039 

14040 . Change of time unit for proper motion (tropical to Julian). 

14041 

14042 . FK4 positions include the E-terms of aberration, to simplify 

14043 the hand computation of annual aberration. FK5 positions 

14044 assume a rigorous aberration computation based on the Earth's 

14045 barycentric velocity. 

14046 

14047 . The E-terms also affect proper motions, and in particular cause 

14048 objects at large distances to exhibit fictitious proper 

14049 motions. 

14050 

14051 The algorithm is based on Smith et al. (1989) and Yallop et al. 

14052 (1989), which presented a matrix method due to Standish (1982) as 

14053 developed by Aoki et al. (1983), using Kinoshita's development of 

14054 Andoyer's post-Newcomb precession. The numerical constants from 

14055 Seidelmann (1992) are used canonically. 

14056 

14057 3) Conversion from B1950.0 FK4 to J2000.0 FK5 only is provided for. 

14058 Conversions for different epochs and equinoxes would require 

14059 additional treatment for precession, proper motion and E-terms. 

14060 

14061 4) In the FK4 catalog the proper motions of stars within 10 degrees 

14062 of the poles do not embody differential E-terms effects and 

14063 should, strictly speaking, be handled in a different manner from 

14064 stars outside these regions. However, given the general lack of 

14065 homogeneity of the star data available for routine astrometry, 

14066 the difficulties of handling positions that may have been 

14067 determined from astrometric fields spanning the polar and non- 

14068 polar regions, the likelihood that the differential E-terms 

14069 effect was not taken into account when allowing for proper motion 

14070 in past astrometry, and the undesirability of a discontinuity in 

14071 the algorithm, the decision has been made in this ERFA algorithm 

14072 to include the effects of differential E-terms on the proper 

14073 motions for all stars, whether polar or not. At epoch J2000.0, 

14074 and measuring "on the sky" rather than in terms of RA change, the 

14075 errors resulting from this simplification are less than 

14076 1 milliarcsecond in position and 1 milliarcsecond per century in 

14077 proper motion. 

14078 

14079 Called: 

14080 eraAnp normalize angle into range 0 to 2pi 

14081 eraPv2s pv-vector to spherical coordinates 

14082 eraPdp scalar product of two p-vectors 

14083 eraPvmpv pv-vector minus pv_vector 

14084 eraPvppv pv-vector plus pv_vector 

14085 eraS2pv spherical coordinates to pv-vector 

14086 eraSxp multiply p-vector by scalar 

14087 

14088 References: 

14089 

14090 Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0 

14091 FK4-based positions of stars to epoch J2000.0 positions in 

14092 accordance with the new IAU resolutions". Astron.Astrophys. 

14093 128, 263-267. 

14094 

14095 Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the 

14096 Astronomical Almanac", ISBN 0-935702-68-7. 

14097 

14098 Smith, C.A. et al., 1989, "The transformation of astrometric 

14099 catalog systems to the equinox J2000.0". Astron.J. 97, 265. 

14100 

14101 Standish, E.M., 1982, "Conversion of positions and proper motions 

14102 from B1950.0 to the IAU system at J2000.0". Astron.Astrophys., 

14103 115, 1, 20-22. 

14104 

14105 Yallop, B.D. et al., 1989, "Transformation of mean star places 

14106 from FK4 B1950.0 to FK5 J2000.0 using matrices in 6-space". 

14107 Astron.J. 97, 274. 

14108 

14109 This revision: 2021 February 24 

14110 

14111 Copyright (C) 2013-2021, NumFOCUS Foundation. 

14112 Derived, with permission, from the SOFA library. See notes at end of file. 

14113 

14114 """ 

14115 r2000, d2000, dr2000, dd2000, p2000, v2000 = ufunc.fk425( 

14116 r1950, d1950, dr1950, dd1950, p1950, v1950) 

14117 return r2000, d2000, dr2000, dd2000, p2000, v2000 

14118 

14119 

14120def fk45z(r1950, d1950, bepoch): 

14121 """ 

14122 Convert a B1950.0 FK4 star position to J2000.0 FK5, assuming zero 

14123 proper motion in the FK5 system. 

14124 

14125 Parameters 

14126 ---------- 

14127 r1950 : double array 

14128 d1950 : double array 

14129 bepoch : double array 

14130 

14131 Returns 

14132 ------- 

14133 r2000 : double array 

14134 d2000 : double array 

14135 

14136 Notes 

14137 ----- 

14138 Wraps ERFA function ``eraFk45z``. The ERFA documentation is:: 

14139 

14140 - - - - - - - - - 

14141 e r a F k 4 5 z 

14142 - - - - - - - - - 

14143 

14144 Convert a B1950.0 FK4 star position to J2000.0 FK5, assuming zero 

14145 proper motion in the FK5 system. 

14146 

14147 This function converts a star's catalog data from the old FK4 

14148 (Bessel-Newcomb) system to the later IAU 1976 FK5 (Fricke) system, 

14149 in such a way that the FK5 proper motion is zero. Because such a 

14150 star has, in general, a non-zero proper motion in the FK4 system, 

14151 the function requires the epoch at which the position in the FK4 

14152 system was determined. 

14153 

14154 Given: 

14155 r1950,d1950 double B1950.0 FK4 RA,Dec at epoch (rad) 

14156 bepoch double Besselian epoch (e.g. 1979.3) 

14157 

14158 Returned: 

14159 r2000,d2000 double J2000.0 FK5 RA,Dec (rad) 

14160 

14161 Notes: 

14162 

14163 1) The epoch bepoch is strictly speaking Besselian, but if a 

14164 Julian epoch is supplied the result will be affected only to a 

14165 negligible extent. 

14166 

14167 2) The method is from Appendix 2 of Aoki et al. (1983), but using 

14168 the constants of Seidelmann (1992). See the function eraFk425 

14169 for a general introduction to the FK4 to FK5 conversion. 

14170 

14171 3) Conversion from equinox B1950.0 FK4 to equinox J2000.0 FK5 only 

14172 is provided for. Conversions for different starting and/or 

14173 ending epochs would require additional treatment for precession, 

14174 proper motion and E-terms. 

14175 

14176 4) In the FK4 catalog the proper motions of stars within 10 degrees 

14177 of the poles do not embody differential E-terms effects and 

14178 should, strictly speaking, be handled in a different manner from 

14179 stars outside these regions. However, given the general lack of 

14180 homogeneity of the star data available for routine astrometry, 

14181 the difficulties of handling positions that may have been 

14182 determined from astrometric fields spanning the polar and non- 

14183 polar regions, the likelihood that the differential E-terms 

14184 effect was not taken into account when allowing for proper motion 

14185 in past astrometry, and the undesirability of a discontinuity in 

14186 the algorithm, the decision has been made in this ERFA algorithm 

14187 to include the effects of differential E-terms on the proper 

14188 motions for all stars, whether polar or not. At epoch 2000.0, 

14189 and measuring "on the sky" rather than in terms of RA change, the 

14190 errors resulting from this simplification are less than 

14191 1 milliarcsecond in position and 1 milliarcsecond per century in 

14192 proper motion. 

14193 

14194 References: 

14195 

14196 Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0 

14197 FK4-based positions of stars to epoch J2000.0 positions in 

14198 accordance with the new IAU resolutions". Astron.Astrophys. 

14199 128, 263-267. 

14200 

14201 Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the 

14202 Astronomical Almanac", ISBN 0-935702-68-7. 

14203 

14204 Called: 

14205 eraAnp normalize angle into range 0 to 2pi 

14206 eraC2s p-vector to spherical 

14207 eraEpb2jd Besselian epoch to Julian date 

14208 eraEpj Julian date to Julian epoch 

14209 eraPdp scalar product of two p-vectors 

14210 eraPmp p-vector minus p-vector 

14211 eraPpsp p-vector plus scaled p-vector 

14212 eraPvu update a pv-vector 

14213 eraS2c spherical to p-vector 

14214 

14215 This revision: 2021 February 24 

14216 

14217 Copyright (C) 2013-2021, NumFOCUS Foundation. 

14218 Derived, with permission, from the SOFA library. See notes at end of file. 

14219 

14220 """ 

14221 r2000, d2000 = ufunc.fk45z(r1950, d1950, bepoch) 

14222 return r2000, d2000 

14223 

14224 

14225def fk524(r2000, d2000, dr2000, dd2000, p2000, v2000): 

14226 """ 

14227 Convert J2000.0 FK5 star catalog data to B1950.0 FK4. 

14228 

14229 Parameters 

14230 ---------- 

14231 r2000 : double array 

14232 d2000 : double array 

14233 dr2000 : double array 

14234 dd2000 : double array 

14235 p2000 : double array 

14236 v2000 : double array 

14237 

14238 Returns 

14239 ------- 

14240 r1950 : double array 

14241 d1950 : double array 

14242 dr1950 : double array 

14243 dd1950 : double array 

14244 p1950 : double array 

14245 v1950 : double array 

14246 

14247 Notes 

14248 ----- 

14249 Wraps ERFA function ``eraFk524``. The ERFA documentation is:: 

14250 

14251 - - - - - - - - - 

14252 e r a F k 5 2 4 

14253 - - - - - - - - - 

14254 

14255 Convert J2000.0 FK5 star catalog data to B1950.0 FK4. 

14256 

14257 Given: (all J2000.0, FK5) 

14258 r2000,d2000 double J2000.0 RA,Dec (rad) 

14259 dr2000,dd2000 double J2000.0 proper motions (rad/Jul.yr) 

14260 p2000 double parallax (arcsec) 

14261 v2000 double radial velocity (km/s, +ve = moving away) 

14262 

14263 Returned: (all B1950.0, FK4) 

14264 r1950,d1950 double B1950.0 RA,Dec (rad) 

14265 dr1950,dd1950 double B1950.0 proper motions (rad/trop.yr) 

14266 p1950 double parallax (arcsec) 

14267 v1950 double radial velocity (km/s, +ve = moving away) 

14268 

14269 Notes: 

14270 

14271 1) The proper motions in RA are dRA/dt rather than cos(Dec)*dRA/dt, 

14272 and are per year rather than per century. 

14273 

14274 2) The conversion is somewhat complicated, for several reasons: 

14275 

14276 . Change of standard epoch from J2000.0 to B1950.0. 

14277 

14278 . An intermediate transition date of 1984 January 1.0 TT. 

14279 

14280 . A change of precession model. 

14281 

14282 . Change of time unit for proper motion (Julian to tropical). 

14283 

14284 . FK4 positions include the E-terms of aberration, to simplify 

14285 the hand computation of annual aberration. FK5 positions 

14286 assume a rigorous aberration computation based on the Earth's 

14287 barycentric velocity. 

14288 

14289 . The E-terms also affect proper motions, and in particular cause 

14290 objects at large distances to exhibit fictitious proper 

14291 motions. 

14292 

14293 The algorithm is based on Smith et al. (1989) and Yallop et al. 

14294 (1989), which presented a matrix method due to Standish (1982) as 

14295 developed by Aoki et al. (1983), using Kinoshita's development of 

14296 Andoyer's post-Newcomb precession. The numerical constants from 

14297 Seidelmann (1992) are used canonically. 

14298 

14299 4) In the FK4 catalog the proper motions of stars within 10 degrees 

14300 of the poles do not embody differential E-terms effects and 

14301 should, strictly speaking, be handled in a different manner from 

14302 stars outside these regions. However, given the general lack of 

14303 homogeneity of the star data available for routine astrometry, 

14304 the difficulties of handling positions that may have been 

14305 determined from astrometric fields spanning the polar and non- 

14306 polar regions, the likelihood that the differential E-terms 

14307 effect was not taken into account when allowing for proper motion 

14308 in past astrometry, and the undesirability of a discontinuity in 

14309 the algorithm, the decision has been made in this ERFA algorithm 

14310 to include the effects of differential E-terms on the proper 

14311 motions for all stars, whether polar or not. At epoch J2000.0, 

14312 and measuring "on the sky" rather than in terms of RA change, the 

14313 errors resulting from this simplification are less than 

14314 1 milliarcsecond in position and 1 milliarcsecond per century in 

14315 proper motion. 

14316 

14317 Called: 

14318 eraAnp normalize angle into range 0 to 2pi 

14319 eraPdp scalar product of two p-vectors 

14320 eraPm modulus of p-vector 

14321 eraPmp p-vector minus p-vector 

14322 eraPpp p-vector pluus p-vector 

14323 eraPv2s pv-vector to spherical coordinates 

14324 eraS2pv spherical coordinates to pv-vector 

14325 eraSxp multiply p-vector by scalar 

14326 

14327 References: 

14328 

14329 Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0 

14330 FK4-based positions of stars to epoch J2000.0 positions in 

14331 accordance with the new IAU resolutions". Astron.Astrophys. 

14332 128, 263-267. 

14333 

14334 Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the 

14335 Astronomical Almanac", ISBN 0-935702-68-7. 

14336 

14337 Smith, C.A. et al., 1989, "The transformation of astrometric 

14338 catalog systems to the equinox J2000.0". Astron.J. 97, 265. 

14339 

14340 Standish, E.M., 1982, "Conversion of positions and proper motions 

14341 from B1950.0 to the IAU system at J2000.0". Astron.Astrophys., 

14342 115, 1, 20-22. 

14343 

14344 Yallop, B.D. et al., 1989, "Transformation of mean star places 

14345 from FK4 B1950.0 to FK5 J2000.0 using matrices in 6-space". 

14346 Astron.J. 97, 274. 

14347 

14348 This revision: 2021 February 24 

14349 

14350 Copyright (C) 2013-2021, NumFOCUS Foundation. 

14351 Derived, with permission, from the SOFA library. See notes at end of file. 

14352 

14353 """ 

14354 r1950, d1950, dr1950, dd1950, p1950, v1950 = ufunc.fk524( 

14355 r2000, d2000, dr2000, dd2000, p2000, v2000) 

14356 return r1950, d1950, dr1950, dd1950, p1950, v1950 

14357 

14358 

14359def fk52h(r5, d5, dr5, dd5, px5, rv5): 

14360 """ 

14361 Transform FK5 (J2000.0) star data into the Hipparcos system. 

14362 

14363 Parameters 

14364 ---------- 

14365 r5 : double array 

14366 d5 : double array 

14367 dr5 : double array 

14368 dd5 : double array 

14369 px5 : double array 

14370 rv5 : double array 

14371 

14372 Returns 

14373 ------- 

14374 rh : double array 

14375 dh : double array 

14376 drh : double array 

14377 ddh : double array 

14378 pxh : double array 

14379 rvh : double array 

14380 

14381 Notes 

14382 ----- 

14383 Wraps ERFA function ``eraFk52h``. The ERFA documentation is:: 

14384 

14385 - - - - - - - - - 

14386 e r a F k 5 2 h 

14387 - - - - - - - - - 

14388 

14389 Transform FK5 (J2000.0) star data into the Hipparcos system. 

14390 

14391 Given (all FK5, equinox J2000.0, epoch J2000.0): 

14392 r5 double RA (radians) 

14393 d5 double Dec (radians) 

14394 dr5 double proper motion in RA (dRA/dt, rad/Jyear) 

14395 dd5 double proper motion in Dec (dDec/dt, rad/Jyear) 

14396 px5 double parallax (arcsec) 

14397 rv5 double radial velocity (km/s, positive = receding) 

14398 

14399 Returned (all Hipparcos, epoch J2000.0): 

14400 rh double RA (radians) 

14401 dh double Dec (radians) 

14402 drh double proper motion in RA (dRA/dt, rad/Jyear) 

14403 ddh double proper motion in Dec (dDec/dt, rad/Jyear) 

14404 pxh double parallax (arcsec) 

14405 rvh double radial velocity (km/s, positive = receding) 

14406 

14407 Notes: 

14408 

14409 1) This function transforms FK5 star positions and proper motions 

14410 into the system of the Hipparcos catalog. 

14411 

14412 2) The proper motions in RA are dRA/dt rather than 

14413 cos(Dec)*dRA/dt, and are per year rather than per century. 

14414 

14415 3) The FK5 to Hipparcos transformation is modeled as a pure 

14416 rotation and spin; zonal errors in the FK5 catalog are not 

14417 taken into account. 

14418 

14419 4) See also eraH2fk5, eraFk5hz, eraHfk5z. 

14420 

14421 Called: 

14422 eraStarpv star catalog data to space motion pv-vector 

14423 eraFk5hip FK5 to Hipparcos rotation and spin 

14424 eraRxp product of r-matrix and p-vector 

14425 eraPxp vector product of two p-vectors 

14426 eraPpp p-vector plus p-vector 

14427 eraPvstar space motion pv-vector to star catalog data 

14428 

14429 Reference: 

14430 

14431 F.Mignard & M.Froeschle, Astron.Astrophys., 354, 732-739 (2000). 

14432 

14433 This revision: 2021 May 11 

14434 

14435 Copyright (C) 2013-2021, NumFOCUS Foundation. 

14436 Derived, with permission, from the SOFA library. See notes at end of file. 

14437 

14438 """ 

14439 rh, dh, drh, ddh, pxh, rvh = ufunc.fk52h(r5, d5, dr5, dd5, px5, rv5) 

14440 return rh, dh, drh, ddh, pxh, rvh 

14441 

14442 

14443def fk54z(r2000, d2000, bepoch): 

14444 """ 

14445 Convert a J2000.0 FK5 star position to B1950.0 FK4, assuming zero 

14446 proper motion in FK5 and parallax. 

14447 

14448 Parameters 

14449 ---------- 

14450 r2000 : double array 

14451 d2000 : double array 

14452 bepoch : double array 

14453 

14454 Returns 

14455 ------- 

14456 r1950 : double array 

14457 d1950 : double array 

14458 dr1950 : double array 

14459 dd1950 : double array 

14460 

14461 Notes 

14462 ----- 

14463 Wraps ERFA function ``eraFk54z``. The ERFA documentation is:: 

14464 

14465 - - - - - - - - - 

14466 e r a F k 5 4 z 

14467 - - - - - - - - - 

14468 

14469 Convert a J2000.0 FK5 star position to B1950.0 FK4, assuming zero 

14470 proper motion in FK5 and parallax. 

14471 

14472 Given: 

14473 r2000,d2000 double J2000.0 FK5 RA,Dec (rad) 

14474 bepoch double Besselian epoch (e.g. 1950.0) 

14475 

14476 Returned: 

14477 r1950,d1950 double B1950.0 FK4 RA,Dec (rad) at epoch BEPOCH 

14478 dr1950,dd1950 double B1950.0 FK4 proper motions (rad/trop.yr) 

14479 

14480 Notes: 

14481 

14482 1) In contrast to the eraFk524 function, here the FK5 proper 

14483 motions, the parallax and the radial velocity are presumed zero. 

14484 

14485 2) This function converts a star position from the IAU 1976 FK5 

14486 (Fricke) system to the former FK4 (Bessel-Newcomb) system, for 

14487 cases such as distant radio sources where it is presumed there is 

14488 zero parallax and no proper motion. Because of the E-terms of 

14489 aberration, such objects have (in general) non-zero proper motion 

14490 in FK4, and the present function returns those fictitious proper 

14491 motions. 

14492 

14493 3) Conversion from B1950.0 FK4 to J2000.0 FK5 only is provided for. 

14494 Conversions involving other equinoxes would require additional 

14495 treatment for precession. 

14496 

14497 4) The position returned by this function is in the B1950.0 FK4 

14498 reference system but at Besselian epoch BEPOCH. For comparison 

14499 with catalogs the BEPOCH argument will frequently be 1950.0. (In 

14500 this context the distinction between Besselian and Julian epoch 

14501 is insignificant.) 

14502 

14503 5) The RA component of the returned (fictitious) proper motion is 

14504 dRA/dt rather than cos(Dec)*dRA/dt. 

14505 

14506 Called: 

14507 eraAnp normalize angle into range 0 to 2pi 

14508 eraC2s p-vector to spherical 

14509 eraFk524 FK4 to FK5 

14510 eraS2c spherical to p-vector 

14511 

14512 This revision: 2020 November 19 

14513 

14514 Copyright (C) 2013-2021, NumFOCUS Foundation. 

14515 Derived, with permission, from the SOFA library. See notes at end of file. 

14516 

14517 """ 

14518 r1950, d1950, dr1950, dd1950 = ufunc.fk54z(r2000, d2000, bepoch) 

14519 return r1950, d1950, dr1950, dd1950 

14520 

14521 

14522def fk5hip(): 

14523 """ 

14524 FK5 to Hipparcos rotation and spin. 

14525 

14526 Returns 

14527 ------- 

14528 r5h : double array 

14529 s5h : double array 

14530 

14531 Notes 

14532 ----- 

14533 Wraps ERFA function ``eraFk5hip``. The ERFA documentation is:: 

14534 

14535 - - - - - - - - - - 

14536 e r a F k 5 h i p 

14537 - - - - - - - - - - 

14538 

14539 FK5 to Hipparcos rotation and spin. 

14540 

14541 Returned: 

14542 r5h double[3][3] r-matrix: FK5 rotation wrt Hipparcos (Note 2) 

14543 s5h double[3] r-vector: FK5 spin wrt Hipparcos (Note 3) 

14544 

14545 Notes: 

14546 

14547 1) This function models the FK5 to Hipparcos transformation as a 

14548 pure rotation and spin; zonal errors in the FK5 catalogue are 

14549 not taken into account. 

14550 

14551 2) The r-matrix r5h operates in the sense: 

14552 

14553 P_Hipparcos = r5h x P_FK5 

14554 

14555 where P_FK5 is a p-vector in the FK5 frame, and P_Hipparcos is 

14556 the equivalent Hipparcos p-vector. 

14557 

14558 3) The r-vector s5h represents the time derivative of the FK5 to 

14559 Hipparcos rotation. The units are radians per year (Julian, 

14560 TDB). 

14561 

14562 Called: 

14563 eraRv2m r-vector to r-matrix 

14564 

14565 Reference: 

14566 

14567 F.Mignard & M.Froeschle, Astron.Astrophys., 354, 732-739 (2000). 

14568 

14569 This revision: 2021 May 11 

14570 

14571 Copyright (C) 2013-2021, NumFOCUS Foundation. 

14572 Derived, with permission, from the SOFA library. See notes at end of file. 

14573 

14574 """ 

14575 r5h, s5h = ufunc.fk5hip() 

14576 return r5h, s5h 

14577 

14578 

14579def fk5hz(r5, d5, date1, date2): 

14580 """ 

14581 Transform an FK5 (J2000.0) star position into the system of the 

14582 Hipparcos catalogue, assuming zero Hipparcos proper motion. 

14583 

14584 Parameters 

14585 ---------- 

14586 r5 : double array 

14587 d5 : double array 

14588 date1 : double array 

14589 date2 : double array 

14590 

14591 Returns 

14592 ------- 

14593 rh : double array 

14594 dh : double array 

14595 

14596 Notes 

14597 ----- 

14598 Wraps ERFA function ``eraFk5hz``. The ERFA documentation is:: 

14599 

14600 - - - - - - - - - 

14601 e r a F k 5 h z 

14602 - - - - - - - - - 

14603 

14604 Transform an FK5 (J2000.0) star position into the system of the 

14605 Hipparcos catalogue, assuming zero Hipparcos proper motion. 

14606 

14607 Given: 

14608 r5 double FK5 RA (radians), equinox J2000.0, at date 

14609 d5 double FK5 Dec (radians), equinox J2000.0, at date 

14610 date1,date2 double TDB date (Notes 1,2) 

14611 

14612 Returned: 

14613 rh double Hipparcos RA (radians) 

14614 dh double Hipparcos Dec (radians) 

14615 

14616 Notes: 

14617 

14618 1) This function converts a star position from the FK5 system to 

14619 the Hipparcos system, in such a way that the Hipparcos proper 

14620 motion is zero. Because such a star has, in general, a non-zero 

14621 proper motion in the FK5 system, the function requires the date 

14622 at which the position in the FK5 system was determined. 

14623 

14624 2) The TT date date1+date2 is a Julian Date, apportioned in any 

14625 convenient way between the two arguments. For example, 

14626 JD(TT)=2450123.7 could be expressed in any of these ways, 

14627 among others: 

14628 

14629 date1 date2 

14630 

14631 2450123.7 0.0 (JD method) 

14632 2451545.0 -1421.3 (J2000 method) 

14633 2400000.5 50123.2 (MJD method) 

14634 2450123.5 0.2 (date & time method) 

14635 

14636 The JD method is the most natural and convenient to use in 

14637 cases where the loss of several decimal digits of resolution 

14638 is acceptable. The J2000 method is best matched to the way 

14639 the argument is handled internally and will deliver the 

14640 optimum resolution. The MJD method and the date & time methods 

14641 are both good compromises between resolution and convenience. 

14642 

14643 3) The FK5 to Hipparcos transformation is modeled as a pure 

14644 rotation and spin; zonal errors in the FK5 catalogue are not 

14645 taken into account. 

14646 

14647 4) The position returned by this function is in the Hipparcos 

14648 reference system but at date date1+date2. 

14649 

14650 5) See also eraFk52h, eraH2fk5, eraHfk5z. 

14651 

14652 Called: 

14653 eraS2c spherical coordinates to unit vector 

14654 eraFk5hip FK5 to Hipparcos rotation and spin 

14655 eraSxp multiply p-vector by scalar 

14656 eraRv2m r-vector to r-matrix 

14657 eraTrxp product of transpose of r-matrix and p-vector 

14658 eraPxp vector product of two p-vectors 

14659 eraC2s p-vector to spherical 

14660 eraAnp normalize angle into range 0 to 2pi 

14661 

14662 Reference: 

14663 

14664 F.Mignard & M.Froeschle, 2000, Astron.Astrophys. 354, 732-739. 

14665 

14666 This revision: 2021 May 11 

14667 

14668 Copyright (C) 2013-2021, NumFOCUS Foundation. 

14669 Derived, with permission, from the SOFA library. See notes at end of file. 

14670 

14671 """ 

14672 rh, dh = ufunc.fk5hz(r5, d5, date1, date2) 

14673 return rh, dh 

14674 

14675 

14676def h2fk5(rh, dh, drh, ddh, pxh, rvh): 

14677 """ 

14678 Transform Hipparcos star data into the FK5 (J2000.0) system. 

14679 

14680 Parameters 

14681 ---------- 

14682 rh : double array 

14683 dh : double array 

14684 drh : double array 

14685 ddh : double array 

14686 pxh : double array 

14687 rvh : double array 

14688 

14689 Returns 

14690 ------- 

14691 r5 : double array 

14692 d5 : double array 

14693 dr5 : double array 

14694 dd5 : double array 

14695 px5 : double array 

14696 rv5 : double array 

14697 

14698 Notes 

14699 ----- 

14700 Wraps ERFA function ``eraH2fk5``. The ERFA documentation is:: 

14701 

14702 - - - - - - - - - 

14703 e r a H 2 f k 5 

14704 - - - - - - - - - 

14705 

14706 Transform Hipparcos star data into the FK5 (J2000.0) system. 

14707 

14708 Given (all Hipparcos, epoch J2000.0): 

14709 rh double RA (radians) 

14710 dh double Dec (radians) 

14711 drh double proper motion in RA (dRA/dt, rad/Jyear) 

14712 ddh double proper motion in Dec (dDec/dt, rad/Jyear) 

14713 pxh double parallax (arcsec) 

14714 rvh double radial velocity (km/s, positive = receding) 

14715 

14716 Returned (all FK5, equinox J2000.0, epoch J2000.0): 

14717 r5 double RA (radians) 

14718 d5 double Dec (radians) 

14719 dr5 double proper motion in RA (dRA/dt, rad/Jyear) 

14720 dd5 double proper motion in Dec (dDec/dt, rad/Jyear) 

14721 px5 double parallax (arcsec) 

14722 rv5 double radial velocity (km/s, positive = receding) 

14723 

14724 Notes: 

14725 

14726 1) This function transforms Hipparcos star positions and proper 

14727 motions into FK5 J2000.0. 

14728 

14729 2) The proper motions in RA are dRA/dt rather than 

14730 cos(Dec)*dRA/dt, and are per year rather than per century. 

14731 

14732 3) The FK5 to Hipparcos transformation is modeled as a pure 

14733 rotation and spin; zonal errors in the FK5 catalog are not 

14734 taken into account. 

14735 

14736 4) See also eraFk52h, eraFk5hz, eraHfk5z. 

14737 

14738 Called: 

14739 eraStarpv star catalog data to space motion pv-vector 

14740 eraFk5hip FK5 to Hipparcos rotation and spin 

14741 eraRv2m r-vector to r-matrix 

14742 eraRxp product of r-matrix and p-vector 

14743 eraTrxp product of transpose of r-matrix and p-vector 

14744 eraPxp vector product of two p-vectors 

14745 eraPmp p-vector minus p-vector 

14746 eraPvstar space motion pv-vector to star catalog data 

14747 

14748 Reference: 

14749 

14750 F.Mignard & M.Froeschle, Astron.Astrophys., 354, 732-739 (2000). 

14751 

14752 This revision: 2021 May 11 

14753 

14754 Copyright (C) 2013-2021, NumFOCUS Foundation. 

14755 Derived, with permission, from the SOFA library. See notes at end of file. 

14756 

14757 """ 

14758 r5, d5, dr5, dd5, px5, rv5 = ufunc.h2fk5(rh, dh, drh, ddh, pxh, rvh) 

14759 return r5, d5, dr5, dd5, px5, rv5 

14760 

14761 

14762def hfk5z(rh, dh, date1, date2): 

14763 """ 

14764 Transform a Hipparcos star position into FK5 J2000.0, assuming 

14765 zero Hipparcos proper motion. 

14766 

14767 Parameters 

14768 ---------- 

14769 rh : double array 

14770 dh : double array 

14771 date1 : double array 

14772 date2 : double array 

14773 

14774 Returns 

14775 ------- 

14776 r5 : double array 

14777 d5 : double array 

14778 dr5 : double array 

14779 dd5 : double array 

14780 

14781 Notes 

14782 ----- 

14783 Wraps ERFA function ``eraHfk5z``. The ERFA documentation is:: 

14784 

14785 - - - - - - - - - 

14786 e r a H f k 5 z 

14787 - - - - - - - - - 

14788 

14789 Transform a Hipparcos star position into FK5 J2000.0, assuming 

14790 zero Hipparcos proper motion. 

14791 

14792 Given: 

14793 rh double Hipparcos RA (radians) 

14794 dh double Hipparcos Dec (radians) 

14795 date1,date2 double TDB date (Note 1) 

14796 

14797 Returned (all FK5, equinox J2000.0, date date1+date2): 

14798 r5 double RA (radians) 

14799 d5 double Dec (radians) 

14800 dr5 double FK5 RA proper motion (rad/year, Note 4) 

14801 dd5 double Dec proper motion (rad/year, Note 4) 

14802 

14803 Notes: 

14804 

14805 1) The TT date date1+date2 is a Julian Date, apportioned in any 

14806 convenient way between the two arguments. For example, 

14807 JD(TT)=2450123.7 could be expressed in any of these ways, 

14808 among others: 

14809 

14810 date1 date2 

14811 

14812 2450123.7 0.0 (JD method) 

14813 2451545.0 -1421.3 (J2000 method) 

14814 2400000.5 50123.2 (MJD method) 

14815 2450123.5 0.2 (date & time method) 

14816 

14817 The JD method is the most natural and convenient to use in 

14818 cases where the loss of several decimal digits of resolution 

14819 is acceptable. The J2000 method is best matched to the way 

14820 the argument is handled internally and will deliver the 

14821 optimum resolution. The MJD method and the date & time methods 

14822 are both good compromises between resolution and convenience. 

14823 

14824 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. 

14825 

14826 3) The FK5 to Hipparcos transformation is modeled as a pure rotation 

14827 and spin; zonal errors in the FK5 catalogue are not taken into 

14828 account. 

14829 

14830 4) It was the intention that Hipparcos should be a close 

14831 approximation to an inertial frame, so that distant objects have 

14832 zero proper motion; such objects have (in general) non-zero 

14833 proper motion in FK5, and this function returns those fictitious 

14834 proper motions. 

14835 

14836 5) The position returned by this function is in the FK5 J2000.0 

14837 reference system but at date date1+date2. 

14838 

14839 6) See also eraFk52h, eraH2fk5, eraFk5zhz. 

14840 

14841 Called: 

14842 eraS2c spherical coordinates to unit vector 

14843 eraFk5hip FK5 to Hipparcos rotation and spin 

14844 eraRxp product of r-matrix and p-vector 

14845 eraSxp multiply p-vector by scalar 

14846 eraRxr product of two r-matrices 

14847 eraTrxp product of transpose of r-matrix and p-vector 

14848 eraPxp vector product of two p-vectors 

14849 eraPv2s pv-vector to spherical 

14850 eraAnp normalize angle into range 0 to 2pi 

14851 

14852 Reference: 

14853 

14854 F.Mignard & M.Froeschle, 2000, Astron.Astrophys. 354, 732-739. 

14855 

14856 This revision: 2021 May 11 

14857 

14858 Copyright (C) 2013-2021, NumFOCUS Foundation. 

14859 Derived, with permission, from the SOFA library. See notes at end of file. 

14860 

14861 """ 

14862 r5, d5, dr5, dd5 = ufunc.hfk5z(rh, dh, date1, date2) 

14863 return r5, d5, dr5, dd5 

14864 

14865 

14866def starpm(ra1, dec1, pmr1, pmd1, px1, rv1, ep1a, ep1b, ep2a, ep2b): 

14867 """ 

14868 Star proper motion: update star catalog data for space motion. 

14869 

14870 Parameters 

14871 ---------- 

14872 ra1 : double array 

14873 dec1 : double array 

14874 pmr1 : double array 

14875 pmd1 : double array 

14876 px1 : double array 

14877 rv1 : double array 

14878 ep1a : double array 

14879 ep1b : double array 

14880 ep2a : double array 

14881 ep2b : double array 

14882 

14883 Returns 

14884 ------- 

14885 ra2 : double array 

14886 dec2 : double array 

14887 pmr2 : double array 

14888 pmd2 : double array 

14889 px2 : double array 

14890 rv2 : double array 

14891 

14892 Notes 

14893 ----- 

14894 Wraps ERFA function ``eraStarpm``. The ERFA documentation is:: 

14895 

14896 - - - - - - - - - - 

14897 e r a S t a r p m 

14898 - - - - - - - - - - 

14899 

14900 Star proper motion: update star catalog data for space motion. 

14901 

14902 Given: 

14903 ra1 double right ascension (radians), before 

14904 dec1 double declination (radians), before 

14905 pmr1 double RA proper motion (radians/year), before 

14906 pmd1 double Dec proper motion (radians/year), before 

14907 px1 double parallax (arcseconds), before 

14908 rv1 double radial velocity (km/s, +ve = receding), before 

14909 ep1a double "before" epoch, part A (Note 1) 

14910 ep1b double "before" epoch, part B (Note 1) 

14911 ep2a double "after" epoch, part A (Note 1) 

14912 ep2b double "after" epoch, part B (Note 1) 

14913 

14914 Returned: 

14915 ra2 double right ascension (radians), after 

14916 dec2 double declination (radians), after 

14917 pmr2 double RA proper motion (radians/year), after 

14918 pmd2 double Dec proper motion (radians/year), after 

14919 px2 double parallax (arcseconds), after 

14920 rv2 double radial velocity (km/s, +ve = receding), after 

14921 

14922 Returned (function value): 

14923 int status: 

14924 -1 = system error (should not occur) 

14925 0 = no warnings or errors 

14926 1 = distance overridden (Note 6) 

14927 2 = excessive velocity (Note 7) 

14928 4 = solution didn't converge (Note 8) 

14929 else = binary logical OR of the above warnings 

14930 

14931 Notes: 

14932 

14933 1) The starting and ending TDB dates ep1a+ep1b and ep2a+ep2b are 

14934 Julian Dates, apportioned in any convenient way between the two 

14935 parts (A and B). For example, JD(TDB)=2450123.7 could be 

14936 expressed in any of these ways, among others: 

14937 

14938 epna epnb 

14939 

14940 2450123.7 0.0 (JD method) 

14941 2451545.0 -1421.3 (J2000 method) 

14942 2400000.5 50123.2 (MJD method) 

14943 2450123.5 0.2 (date & time method) 

14944 

14945 The JD method is the most natural and convenient to use in 

14946 cases where the loss of several decimal digits of resolution 

14947 is acceptable. The J2000 method is best matched to the way 

14948 the argument is handled internally and will deliver the 

14949 optimum resolution. The MJD method and the date & time methods 

14950 are both good compromises between resolution and convenience. 

14951 

14952 2) In accordance with normal star-catalog conventions, the object's 

14953 right ascension and declination are freed from the effects of 

14954 secular aberration. The frame, which is aligned to the catalog 

14955 equator and equinox, is Lorentzian and centered on the SSB. 

14956 

14957 The proper motions are the rate of change of the right ascension 

14958 and declination at the catalog epoch and are in radians per TDB 

14959 Julian year. 

14960 

14961 The parallax and radial velocity are in the same frame. 

14962 

14963 3) Care is needed with units. The star coordinates are in radians 

14964 and the proper motions in radians per Julian year, but the 

14965 parallax is in arcseconds. 

14966 

14967 4) The RA proper motion is in terms of coordinate angle, not true 

14968 angle. If the catalog uses arcseconds for both RA and Dec proper 

14969 motions, the RA proper motion will need to be divided by cos(Dec) 

14970 before use. 

14971 

14972 5) Straight-line motion at constant speed, in the inertial frame, 

14973 is assumed. 

14974 

14975 6) An extremely small (or zero or negative) parallax is interpreted 

14976 to mean that the object is on the "celestial sphere", the radius 

14977 of which is an arbitrary (large) value (see the eraStarpv 

14978 function for the value used). When the distance is overridden in 

14979 this way, the status, initially zero, has 1 added to it. 

14980 

14981 7) If the space velocity is a significant fraction of c (see the 

14982 constant VMAX in the function eraStarpv), it is arbitrarily set 

14983 to zero. When this action occurs, 2 is added to the status. 

14984 

14985 8) The relativistic adjustment carried out in the eraStarpv function 

14986 involves an iterative calculation. If the process fails to 

14987 converge within a set number of iterations, 4 is added to the 

14988 status. 

14989 

14990 Called: 

14991 eraStarpv star catalog data to space motion pv-vector 

14992 eraPvu update a pv-vector 

14993 eraPdp scalar product of two p-vectors 

14994 eraPvstar space motion pv-vector to star catalog data 

14995 

14996 This revision: 2021 May 11 

14997 

14998 Copyright (C) 2013-2021, NumFOCUS Foundation. 

14999 Derived, with permission, from the SOFA library. See notes at end of file. 

15000 

15001 """ 

15002 ra2, dec2, pmr2, pmd2, px2, rv2, c_retval = ufunc.starpm( 

15003 ra1, dec1, pmr1, pmd1, px1, rv1, ep1a, ep1b, ep2a, ep2b) 

15004 check_errwarn(c_retval, 'starpm') 

15005 return ra2, dec2, pmr2, pmd2, px2, rv2 

15006 

15007 

15008STATUS_CODES['starpm'] = { 

15009 -1: 'system error (should not occur)', 

15010 0: 'no warnings or errors', 

15011 1: 'distance overridden (Note 6)', 

15012 2: 'excessive velocity (Note 7)', 

15013 4: "solution didn't converge (Note 8)", 

15014 'else': 'binary logical OR of the above warnings', 

15015} 

15016 

15017 

15018def eceq06(date1, date2, dl, db): 

15019 """ 

15020 Transformation from ecliptic coordinates (mean equinox and ecliptic 

15021 of date) to ICRS RA,Dec, using the IAU 2006 precession model. 

15022 

15023 Parameters 

15024 ---------- 

15025 date1 : double array 

15026 date2 : double array 

15027 dl : double array 

15028 db : double array 

15029 

15030 Returns 

15031 ------- 

15032 dr : double array 

15033 dd : double array 

15034 

15035 Notes 

15036 ----- 

15037 Wraps ERFA function ``eraEceq06``. The ERFA documentation is:: 

15038 

15039 - - - - - - - - - - 

15040 e r a E c e q 0 6 

15041 - - - - - - - - - - 

15042 

15043 Transformation from ecliptic coordinates (mean equinox and ecliptic 

15044 of date) to ICRS RA,Dec, using the IAU 2006 precession model. 

15045 

15046 Given: 

15047 date1,date2 double TT as a 2-part Julian date (Note 1) 

15048 dl,db double ecliptic longitude and latitude (radians) 

15049 

15050 Returned: 

15051 dr,dd double ICRS right ascension and declination (radians) 

15052 

15053 1) The TT date date1+date2 is a Julian Date, apportioned in any 

15054 convenient way between the two arguments. For example, 

15055 JD(TT)=2450123.7 could be expressed in any of these ways, 

15056 among others: 

15057 

15058 date1 date2 

15059 

15060 2450123.7 0.0 (JD method) 

15061 2451545.0 -1421.3 (J2000 method) 

15062 2400000.5 50123.2 (MJD method) 

15063 2450123.5 0.2 (date & time method) 

15064 

15065 The JD method is the most natural and convenient to use in 

15066 cases where the loss of several decimal digits of resolution 

15067 is acceptable. The J2000 method is best matched to the way 

15068 the argument is handled internally and will deliver the 

15069 optimum resolution. The MJD method and the date & time methods 

15070 are both good compromises between resolution and convenience. 

15071 

15072 2) No assumptions are made about whether the coordinates represent 

15073 starlight and embody astrometric effects such as parallax or 

15074 aberration. 

15075 

15076 3) The transformation is approximately that from ecliptic longitude 

15077 and latitude (mean equinox and ecliptic of date) to mean J2000.0 

15078 right ascension and declination, with only frame bias (always 

15079 less than 25 mas) to disturb this classical picture. 

15080 

15081 Called: 

15082 eraS2c spherical coordinates to unit vector 

15083 eraEcm06 J2000.0 to ecliptic rotation matrix, IAU 2006 

15084 eraTrxp product of transpose of r-matrix and p-vector 

15085 eraC2s unit vector to spherical coordinates 

15086 eraAnp normalize angle into range 0 to 2pi 

15087 eraAnpm normalize angle into range +/- pi 

15088 

15089 This revision: 2021 May 11 

15090 

15091 Copyright (C) 2013-2021, NumFOCUS Foundation. 

15092 Derived, with permission, from the SOFA library. See notes at end of file. 

15093 

15094 """ 

15095 dr, dd = ufunc.eceq06(date1, date2, dl, db) 

15096 return dr, dd 

15097 

15098 

15099def ecm06(date1, date2): 

15100 """ 

15101 ICRS equatorial to ecliptic rotation matrix, IAU 2006. 

15102 

15103 Parameters 

15104 ---------- 

15105 date1 : double array 

15106 date2 : double array 

15107 

15108 Returns 

15109 ------- 

15110 rm : double array 

15111 

15112 Notes 

15113 ----- 

15114 Wraps ERFA function ``eraEcm06``. The ERFA documentation is:: 

15115 

15116 - - - - - - - - - 

15117 e r a E c m 0 6 

15118 - - - - - - - - - 

15119 

15120 ICRS equatorial to ecliptic rotation matrix, IAU 2006. 

15121 

15122 Given: 

15123 date1,date2 double TT as a 2-part Julian date (Note 1) 

15124 

15125 Returned: 

15126 rm double[3][3] ICRS to ecliptic rotation matrix 

15127 

15128 Notes: 

15129 

15130 1) The TT date date1+date2 is a Julian Date, apportioned in any 

15131 convenient way between the two arguments. For example, 

15132 JD(TT)=2450123.7 could be expressed in any of these ways, 

15133 among others: 

15134 

15135 date1 date2 

15136 

15137 2450123.7 0.0 (JD method) 

15138 2451545.0 -1421.3 (J2000 method) 

15139 2400000.5 50123.2 (MJD method) 

15140 2450123.5 0.2 (date & time method) 

15141 

15142 The JD method is the most natural and convenient to use in 

15143 cases where the loss of several decimal digits of resolution 

15144 is acceptable. The J2000 method is best matched to the way 

15145 the argument is handled internally and will deliver the 

15146 optimum resolution. The MJD method and the date & time methods 

15147 are both good compromises between resolution and convenience. 

15148 

15149 1) The matrix is in the sense 

15150 

15151 E_ep = rm x P_ICRS, 

15152 

15153 where P_ICRS is a vector with respect to ICRS right ascension 

15154 and declination axes and E_ep is the same vector with respect to 

15155 the (inertial) ecliptic and equinox of date. 

15156 

15157 2) P_ICRS is a free vector, merely a direction, typically of unit 

15158 magnitude, and not bound to any particular spatial origin, such 

15159 as the Earth, Sun or SSB. No assumptions are made about whether 

15160 it represents starlight and embodies astrometric effects such as 

15161 parallax or aberration. The transformation is approximately that 

15162 between mean J2000.0 right ascension and declination and ecliptic 

15163 longitude and latitude, with only frame bias (always less than 

15164 25 mas) to disturb this classical picture. 

15165 

15166 Called: 

15167 eraObl06 mean obliquity, IAU 2006 

15168 eraPmat06 PB matrix, IAU 2006 

15169 eraIr initialize r-matrix to identity 

15170 eraRx rotate around X-axis 

15171 eraRxr product of two r-matrices 

15172 

15173 This revision: 2021 May 11 

15174 

15175 Copyright (C) 2013-2021, NumFOCUS Foundation. 

15176 Derived, with permission, from the SOFA library. See notes at end of file. 

15177 

15178 """ 

15179 rm = ufunc.ecm06(date1, date2) 

15180 return rm 

15181 

15182 

15183def eqec06(date1, date2, dr, dd): 

15184 """ 

15185 Transformation from ICRS equatorial coordinates to ecliptic 

15186 coordinates (mean equinox and ecliptic of date) using IAU 2006 

15187 precession model. 

15188 

15189 Parameters 

15190 ---------- 

15191 date1 : double array 

15192 date2 : double array 

15193 dr : double array 

15194 dd : double array 

15195 

15196 Returns 

15197 ------- 

15198 dl : double array 

15199 db : double array 

15200 

15201 Notes 

15202 ----- 

15203 Wraps ERFA function ``eraEqec06``. The ERFA documentation is:: 

15204 

15205 - - - - - - - - - - 

15206 e r a E q e c 0 6 

15207 - - - - - - - - - - 

15208 

15209 Transformation from ICRS equatorial coordinates to ecliptic 

15210 coordinates (mean equinox and ecliptic of date) using IAU 2006 

15211 precession model. 

15212 

15213 Given: 

15214 date1,date2 double TT as a 2-part Julian date (Note 1) 

15215 dr,dd double ICRS right ascension and declination (radians) 

15216 

15217 Returned: 

15218 dl,db double ecliptic longitude and latitude (radians) 

15219 

15220 1) The TT date date1+date2 is a Julian Date, apportioned in any 

15221 convenient way between the two arguments. For example, 

15222 JD(TT)=2450123.7 could be expressed in any of these ways, 

15223 among others: 

15224 

15225 date1 date2 

15226 

15227 2450123.7 0.0 (JD method) 

15228 2451545.0 -1421.3 (J2000 method) 

15229 2400000.5 50123.2 (MJD method) 

15230 2450123.5 0.2 (date & time method) 

15231 

15232 The JD method is the most natural and convenient to use in 

15233 cases where the loss of several decimal digits of resolution 

15234 is acceptable. The J2000 method is best matched to the way 

15235 the argument is handled internally and will deliver the 

15236 optimum resolution. The MJD method and the date & time methods 

15237 are both good compromises between resolution and convenience. 

15238 

15239 2) No assumptions are made about whether the coordinates represent 

15240 starlight and embody astrometric effects such as parallax or 

15241 aberration. 

15242 

15243 3) The transformation is approximately that from mean J2000.0 right 

15244 ascension and declination to ecliptic longitude and latitude 

15245 (mean equinox and ecliptic of date), with only frame bias (always 

15246 less than 25 mas) to disturb this classical picture. 

15247 

15248 Called: 

15249 eraS2c spherical coordinates to unit vector 

15250 eraEcm06 J2000.0 to ecliptic rotation matrix, IAU 2006 

15251 eraRxp product of r-matrix and p-vector 

15252 eraC2s unit vector to spherical coordinates 

15253 eraAnp normalize angle into range 0 to 2pi 

15254 eraAnpm normalize angle into range +/- pi 

15255 

15256 This revision: 2021 May 11 

15257 

15258 Copyright (C) 2013-2021, NumFOCUS Foundation. 

15259 Derived, with permission, from the SOFA library. See notes at end of file. 

15260 

15261 """ 

15262 dl, db = ufunc.eqec06(date1, date2, dr, dd) 

15263 return dl, db 

15264 

15265 

15266def lteceq(epj, dl, db): 

15267 """ 

15268 Transformation from ecliptic coordinates (mean equinox and ecliptic 

15269 of date) to ICRS RA,Dec, using a long-term precession model. 

15270 

15271 Parameters 

15272 ---------- 

15273 epj : double array 

15274 dl : double array 

15275 db : double array 

15276 

15277 Returns 

15278 ------- 

15279 dr : double array 

15280 dd : double array 

15281 

15282 Notes 

15283 ----- 

15284 Wraps ERFA function ``eraLteceq``. The ERFA documentation is:: 

15285 

15286 - - - - - - - - - - 

15287 e r a L t e c e q 

15288 - - - - - - - - - - 

15289 

15290 Transformation from ecliptic coordinates (mean equinox and ecliptic 

15291 of date) to ICRS RA,Dec, using a long-term precession model. 

15292 

15293 Given: 

15294 epj double Julian epoch (TT) 

15295 dl,db double ecliptic longitude and latitude (radians) 

15296 

15297 Returned: 

15298 dr,dd double ICRS right ascension and declination (radians) 

15299 

15300 1) No assumptions are made about whether the coordinates represent 

15301 starlight and embody astrometric effects such as parallax or 

15302 aberration. 

15303 

15304 2) The transformation is approximately that from ecliptic longitude 

15305 and latitude (mean equinox and ecliptic of date) to mean J2000.0 

15306 right ascension and declination, with only frame bias (always 

15307 less than 25 mas) to disturb this classical picture. 

15308 

15309 3) The Vondrak et al. (2011, 2012) 400 millennia precession model 

15310 agrees with the IAU 2006 precession at J2000.0 and stays within 

15311 100 microarcseconds during the 20th and 21st centuries. It is 

15312 accurate to a few arcseconds throughout the historical period, 

15313 worsening to a few tenths of a degree at the end of the 

15314 +/- 200,000 year time span. 

15315 

15316 Called: 

15317 eraS2c spherical coordinates to unit vector 

15318 eraLtecm J2000.0 to ecliptic rotation matrix, long term 

15319 eraTrxp product of transpose of r-matrix and p-vector 

15320 eraC2s unit vector to spherical coordinates 

15321 eraAnp normalize angle into range 0 to 2pi 

15322 eraAnpm normalize angle into range +/- pi 

15323 

15324 References: 

15325 

15326 Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession 

15327 expressions, valid for long time intervals, Astron.Astrophys. 534, 

15328 A22 

15329 

15330 Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession 

15331 expressions, valid for long time intervals (Corrigendum), 

15332 Astron.Astrophys. 541, C1 

15333 

15334 This revision: 2021 May 11 

15335 

15336 Copyright (C) 2013-2021, NumFOCUS Foundation. 

15337 Derived, with permission, from the SOFA library. See notes at end of file. 

15338 

15339 """ 

15340 dr, dd = ufunc.lteceq(epj, dl, db) 

15341 return dr, dd 

15342 

15343 

15344def ltecm(epj): 

15345 """ 

15346 ICRS equatorial to ecliptic rotation matrix, long-term. 

15347 

15348 Parameters 

15349 ---------- 

15350 epj : double array 

15351 

15352 Returns 

15353 ------- 

15354 rm : double array 

15355 

15356 Notes 

15357 ----- 

15358 Wraps ERFA function ``eraLtecm``. The ERFA documentation is:: 

15359 

15360 - - - - - - - - - 

15361 e r a L t e c m 

15362 - - - - - - - - - 

15363 

15364 ICRS equatorial to ecliptic rotation matrix, long-term. 

15365 

15366 Given: 

15367 epj double Julian epoch (TT) 

15368 

15369 Returned: 

15370 rm double[3][3] ICRS to ecliptic rotation matrix 

15371 

15372 Notes: 

15373 

15374 1) The matrix is in the sense 

15375 

15376 E_ep = rm x P_ICRS, 

15377 

15378 where P_ICRS is a vector with respect to ICRS right ascension 

15379 and declination axes and E_ep is the same vector with respect to 

15380 the (inertial) ecliptic and equinox of epoch epj. 

15381 

15382 2) P_ICRS is a free vector, merely a direction, typically of unit 

15383 magnitude, and not bound to any particular spatial origin, such 

15384 as the Earth, Sun or SSB. No assumptions are made about whether 

15385 it represents starlight and embodies astrometric effects such as 

15386 parallax or aberration. The transformation is approximately that 

15387 between mean J2000.0 right ascension and declination and ecliptic 

15388 longitude and latitude, with only frame bias (always less than 

15389 25 mas) to disturb this classical picture. 

15390 

15391 3) The Vondrak et al. (2011, 2012) 400 millennia precession model 

15392 agrees with the IAU 2006 precession at J2000.0 and stays within 

15393 100 microarcseconds during the 20th and 21st centuries. It is 

15394 accurate to a few arcseconds throughout the historical period, 

15395 worsening to a few tenths of a degree at the end of the 

15396 +/- 200,000 year time span. 

15397 

15398 Called: 

15399 eraLtpequ equator pole, long term 

15400 eraLtpecl ecliptic pole, long term 

15401 eraPxp vector product 

15402 eraPn normalize vector 

15403 

15404 References: 

15405 

15406 Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession 

15407 expressions, valid for long time intervals, Astron.Astrophys. 534, 

15408 A22 

15409 

15410 Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession 

15411 expressions, valid for long time intervals (Corrigendum), 

15412 Astron.Astrophys. 541, C1 

15413 

15414 This revision: 2021 May 11 

15415 

15416 Copyright (C) 2013-2021, NumFOCUS Foundation. 

15417 Derived, with permission, from the SOFA library. See notes at end of file. 

15418 

15419 """ 

15420 rm = ufunc.ltecm(epj) 

15421 return rm 

15422 

15423 

15424def lteqec(epj, dr, dd): 

15425 """ 

15426 Transformation from ICRS equatorial coordinates to ecliptic 

15427 coordinates (mean equinox and ecliptic of date) using a long-term 

15428 precession model. 

15429 

15430 Parameters 

15431 ---------- 

15432 epj : double array 

15433 dr : double array 

15434 dd : double array 

15435 

15436 Returns 

15437 ------- 

15438 dl : double array 

15439 db : double array 

15440 

15441 Notes 

15442 ----- 

15443 Wraps ERFA function ``eraLteqec``. The ERFA documentation is:: 

15444 

15445 - - - - - - - - - - 

15446 e r a L t e q e c 

15447 - - - - - - - - - - 

15448 

15449 Transformation from ICRS equatorial coordinates to ecliptic 

15450 coordinates (mean equinox and ecliptic of date) using a long-term 

15451 precession model. 

15452 

15453 Given: 

15454 epj double Julian epoch (TT) 

15455 dr,dd double ICRS right ascension and declination (radians) 

15456 

15457 Returned: 

15458 dl,db double ecliptic longitude and latitude (radians) 

15459 

15460 1) No assumptions are made about whether the coordinates represent 

15461 starlight and embody astrometric effects such as parallax or 

15462 aberration. 

15463 

15464 2) The transformation is approximately that from mean J2000.0 right 

15465 ascension and declination to ecliptic longitude and latitude 

15466 (mean equinox and ecliptic of date), with only frame bias (always 

15467 less than 25 mas) to disturb this classical picture. 

15468 

15469 3) The Vondrak et al. (2011, 2012) 400 millennia precession model 

15470 agrees with the IAU 2006 precession at J2000.0 and stays within 

15471 100 microarcseconds during the 20th and 21st centuries. It is 

15472 accurate to a few arcseconds throughout the historical period, 

15473 worsening to a few tenths of a degree at the end of the 

15474 +/- 200,000 year time span. 

15475 

15476 Called: 

15477 eraS2c spherical coordinates to unit vector 

15478 eraLtecm J2000.0 to ecliptic rotation matrix, long term 

15479 eraRxp product of r-matrix and p-vector 

15480 eraC2s unit vector to spherical coordinates 

15481 eraAnp normalize angle into range 0 to 2pi 

15482 eraAnpm normalize angle into range +/- pi 

15483 

15484 References: 

15485 

15486 Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession 

15487 expressions, valid for long time intervals, Astron.Astrophys. 534, 

15488 A22 

15489 

15490 Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession 

15491 expressions, valid for long time intervals (Corrigendum), 

15492 Astron.Astrophys. 541, C1 

15493 

15494 This revision: 2021 May 11 

15495 

15496 Copyright (C) 2013-2021, NumFOCUS Foundation. 

15497 Derived, with permission, from the SOFA library. See notes at end of file. 

15498 

15499 """ 

15500 dl, db = ufunc.lteqec(epj, dr, dd) 

15501 return dl, db 

15502 

15503 

15504def g2icrs(dl, db): 

15505 """ 

15506 Transformation from Galactic Coordinates to ICRS. 

15507 

15508 Parameters 

15509 ---------- 

15510 dl : double array 

15511 db : double array 

15512 

15513 Returns 

15514 ------- 

15515 dr : double array 

15516 dd : double array 

15517 

15518 Notes 

15519 ----- 

15520 Wraps ERFA function ``eraG2icrs``. The ERFA documentation is:: 

15521 

15522 - - - - - - - - - - 

15523 e r a G 2 i c r s 

15524 - - - - - - - - - - 

15525 

15526 Transformation from Galactic Coordinates to ICRS. 

15527 

15528 Given: 

15529 dl double galactic longitude (radians) 

15530 db double galactic latitude (radians) 

15531 

15532 Returned: 

15533 dr double ICRS right ascension (radians) 

15534 dd double ICRS declination (radians) 

15535 

15536 Notes: 

15537 

15538 1) The IAU 1958 system of Galactic coordinates was defined with 

15539 respect to the now obsolete reference system FK4 B1950.0. When 

15540 interpreting the system in a modern context, several factors have 

15541 to be taken into account: 

15542 

15543 . The inclusion in FK4 positions of the E-terms of aberration. 

15544 

15545 . The distortion of the FK4 proper motion system by differential 

15546 Galactic rotation. 

15547 

15548 . The use of the B1950.0 equinox rather than the now-standard 

15549 J2000.0. 

15550 

15551 . The frame bias between ICRS and the J2000.0 mean place system. 

15552 

15553 The Hipparcos Catalogue (Perryman & ESA 1997) provides a rotation 

15554 matrix that transforms directly between ICRS and Galactic 

15555 coordinates with the above factors taken into account. The 

15556 matrix is derived from three angles, namely the ICRS coordinates 

15557 of the Galactic pole and the longitude of the ascending node of 

15558 the galactic equator on the ICRS equator. They are given in 

15559 degrees to five decimal places and for canonical purposes are 

15560 regarded as exact. In the Hipparcos Catalogue the matrix 

15561 elements are given to 10 decimal places (about 20 microarcsec). 

15562 In the present ERFA function the matrix elements have been 

15563 recomputed from the canonical three angles and are given to 30 

15564 decimal places. 

15565 

15566 2) The inverse transformation is performed by the function eraIcrs2g. 

15567 

15568 Called: 

15569 eraAnp normalize angle into range 0 to 2pi 

15570 eraAnpm normalize angle into range +/- pi 

15571 eraS2c spherical coordinates to unit vector 

15572 eraTrxp product of transpose of r-matrix and p-vector 

15573 eraC2s p-vector to spherical 

15574 

15575 Reference: 

15576 Perryman M.A.C. & ESA, 1997, ESA SP-1200, The Hipparcos and Tycho 

15577 catalogues. Astrometric and photometric star catalogues 

15578 derived from the ESA Hipparcos Space Astrometry Mission. ESA 

15579 Publications Division, Noordwijk, Netherlands. 

15580 

15581 This revision: 2021 January 25 

15582 

15583 Copyright (C) 2013-2021, NumFOCUS Foundation. 

15584 Derived, with permission, from the SOFA library. See notes at end of file. 

15585 

15586 """ 

15587 dr, dd = ufunc.g2icrs(dl, db) 

15588 return dr, dd 

15589 

15590 

15591def icrs2g(dr, dd): 

15592 """ 

15593 Transformation from ICRS to Galactic Coordinates. 

15594 

15595 Parameters 

15596 ---------- 

15597 dr : double array 

15598 dd : double array 

15599 

15600 Returns 

15601 ------- 

15602 dl : double array 

15603 db : double array 

15604 

15605 Notes 

15606 ----- 

15607 Wraps ERFA function ``eraIcrs2g``. The ERFA documentation is:: 

15608 

15609 - - - - - - - - - - 

15610 e r a I c r s 2 g 

15611 - - - - - - - - - - 

15612 

15613 Transformation from ICRS to Galactic Coordinates. 

15614 

15615 Given: 

15616 dr double ICRS right ascension (radians) 

15617 dd double ICRS declination (radians) 

15618 

15619 Returned: 

15620 dl double galactic longitude (radians) 

15621 db double galactic latitude (radians) 

15622 

15623 Notes: 

15624 

15625 1) The IAU 1958 system of Galactic coordinates was defined with 

15626 respect to the now obsolete reference system FK4 B1950.0. When 

15627 interpreting the system in a modern context, several factors have 

15628 to be taken into account: 

15629 

15630 . The inclusion in FK4 positions of the E-terms of aberration. 

15631 

15632 . The distortion of the FK4 proper motion system by differential 

15633 Galactic rotation. 

15634 

15635 . The use of the B1950.0 equinox rather than the now-standard 

15636 J2000.0. 

15637 

15638 . The frame bias between ICRS and the J2000.0 mean place system. 

15639 

15640 The Hipparcos Catalogue (Perryman & ESA 1997) provides a rotation 

15641 matrix that transforms directly between ICRS and Galactic 

15642 coordinates with the above factors taken into account. The 

15643 matrix is derived from three angles, namely the ICRS coordinates 

15644 of the Galactic pole and the longitude of the ascending node of 

15645 the galactic equator on the ICRS equator. They are given in 

15646 degrees to five decimal places and for canonical purposes are 

15647 regarded as exact. In the Hipparcos Catalogue the matrix 

15648 elements are given to 10 decimal places (about 20 microarcsec). 

15649 In the present ERFA function the matrix elements have been 

15650 recomputed from the canonical three angles and are given to 30 

15651 decimal places. 

15652 

15653 2) The inverse transformation is performed by the function eraG2icrs. 

15654 

15655 Called: 

15656 eraAnp normalize angle into range 0 to 2pi 

15657 eraAnpm normalize angle into range +/- pi 

15658 eraS2c spherical coordinates to unit vector 

15659 eraRxp product of r-matrix and p-vector 

15660 eraC2s p-vector to spherical 

15661 

15662 Reference: 

15663 Perryman M.A.C. & ESA, 1997, ESA SP-1200, The Hipparcos and Tycho 

15664 catalogues. Astrometric and photometric star catalogues 

15665 derived from the ESA Hipparcos Space Astrometry Mission. ESA 

15666 Publications Division, Noordwijk, Netherlands. 

15667 

15668 This revision: 2021 January 25 

15669 

15670 Copyright (C) 2013-2021, NumFOCUS Foundation. 

15671 Derived, with permission, from the SOFA library. See notes at end of file. 

15672 

15673 """ 

15674 dl, db = ufunc.icrs2g(dr, dd) 

15675 return dl, db 

15676 

15677 

15678def eform(n): 

15679 """ 

15680 Earth reference ellipsoids. 

15681 

15682 Parameters 

15683 ---------- 

15684 n : int array 

15685 

15686 Returns 

15687 ------- 

15688 a : double array 

15689 f : double array 

15690 

15691 Notes 

15692 ----- 

15693 Wraps ERFA function ``eraEform``. The ERFA documentation is:: 

15694 

15695 - - - - - - - - - 

15696 e r a E f o r m 

15697 - - - - - - - - - 

15698 

15699 Earth reference ellipsoids. 

15700 

15701 Given: 

15702 n int ellipsoid identifier (Note 1) 

15703 

15704 Returned: 

15705 a double equatorial radius (meters, Note 2) 

15706 f double flattening (Note 2) 

15707 

15708 Returned (function value): 

15709 int status: 0 = OK 

15710 -1 = illegal identifier (Note 3) 

15711 

15712 Notes: 

15713 

15714 1) The identifier n is a number that specifies the choice of 

15715 reference ellipsoid. The following are supported: 

15716 

15717 n ellipsoid 

15718 

15719 1 ERFA_WGS84 

15720 2 ERFA_GRS80 

15721 3 ERFA_WGS72 

15722 

15723 The n value has no significance outside the ERFA software. For 

15724 convenience, symbols ERFA_WGS84 etc. are defined in erfam.h. 

15725 

15726 2) The ellipsoid parameters are returned in the form of equatorial 

15727 radius in meters (a) and flattening (f). The latter is a number 

15728 around 0.00335, i.e. around 1/298. 

15729 

15730 3) For the case where an unsupported n value is supplied, zero a and 

15731 f are returned, as well as error status. 

15732 

15733 References: 

15734 

15735 Department of Defense World Geodetic System 1984, National 

15736 Imagery and Mapping Agency Technical Report 8350.2, Third 

15737 Edition, p3-2. 

15738 

15739 Moritz, H., Bull. Geodesique 66-2, 187 (1992). 

15740 

15741 The Department of Defense World Geodetic System 1972, World 

15742 Geodetic System Committee, May 1974. 

15743 

15744 Explanatory Supplement to the Astronomical Almanac, 

15745 P. Kenneth Seidelmann (ed), University Science Books (1992), 

15746 p220. 

15747 

15748 This revision: 2021 May 11 

15749 

15750 Copyright (C) 2013-2021, NumFOCUS Foundation. 

15751 Derived, with permission, from the SOFA library. See notes at end of file. 

15752 

15753 """ 

15754 a, f, c_retval = ufunc.eform(n) 

15755 check_errwarn(c_retval, 'eform') 

15756 return a, f 

15757 

15758 

15759STATUS_CODES['eform'] = { 

15760 0: 'OK', 

15761 -1: 'illegal identifier (Note 3)', 

15762} 

15763 

15764 

15765def gc2gd(n, xyz): 

15766 """ 

15767 Transform geocentric coordinates to geodetic using the specified 

15768 reference ellipsoid. 

15769 

15770 Parameters 

15771 ---------- 

15772 n : int array 

15773 xyz : double array 

15774 

15775 Returns 

15776 ------- 

15777 elong : double array 

15778 phi : double array 

15779 height : double array 

15780 

15781 Notes 

15782 ----- 

15783 Wraps ERFA function ``eraGc2gd``. The ERFA documentation is:: 

15784 

15785 - - - - - - - - - 

15786 e r a G c 2 g d 

15787 - - - - - - - - - 

15788 

15789 Transform geocentric coordinates to geodetic using the specified 

15790 reference ellipsoid. 

15791 

15792 Given: 

15793 n int ellipsoid identifier (Note 1) 

15794 xyz double[3] geocentric vector (Note 2) 

15795 

15796 Returned: 

15797 elong double longitude (radians, east +ve, Note 3) 

15798 phi double latitude (geodetic, radians, Note 3) 

15799 height double height above ellipsoid (geodetic, Notes 2,3) 

15800 

15801 Returned (function value): 

15802 int status: 0 = OK 

15803 -1 = illegal identifier (Note 3) 

15804 -2 = internal error (Note 3) 

15805 

15806 Notes: 

15807 

15808 1) The identifier n is a number that specifies the choice of 

15809 reference ellipsoid. The following are supported: 

15810 

15811 n ellipsoid 

15812 

15813 1 ERFA_WGS84 

15814 2 ERFA_GRS80 

15815 3 ERFA_WGS72 

15816 

15817 The n value has no significance outside the ERFA software. For 

15818 convenience, symbols ERFA_WGS84 etc. are defined in erfam.h. 

15819 

15820 2) The geocentric vector (xyz, given) and height (height, returned) 

15821 are in meters. 

15822 

15823 3) An error status -1 means that the identifier n is illegal. An 

15824 error status -2 is theoretically impossible. In all error cases, 

15825 all three results are set to -1e9. 

15826 

15827 4) The inverse transformation is performed in the function eraGd2gc. 

15828 

15829 Called: 

15830 eraEform Earth reference ellipsoids 

15831 eraGc2gde geocentric to geodetic transformation, general 

15832 

15833 This revision: 2021 May 11 

15834 

15835 Copyright (C) 2013-2021, NumFOCUS Foundation. 

15836 Derived, with permission, from the SOFA library. See notes at end of file. 

15837 

15838 """ 

15839 elong, phi, height, c_retval = ufunc.gc2gd(n, xyz) 

15840 check_errwarn(c_retval, 'gc2gd') 

15841 return elong, phi, height 

15842 

15843 

15844STATUS_CODES['gc2gd'] = { 

15845 0: 'OK', 

15846 -1: 'illegal identifier (Note 3)', 

15847 -2: 'internal error (Note 3)', 

15848} 

15849 

15850 

15851def gc2gde(a, f, xyz): 

15852 """ 

15853 Transform geocentric coordinates to geodetic for a reference 

15854 ellipsoid of specified form. 

15855 

15856 Parameters 

15857 ---------- 

15858 a : double array 

15859 f : double array 

15860 xyz : double array 

15861 

15862 Returns 

15863 ------- 

15864 elong : double array 

15865 phi : double array 

15866 height : double array 

15867 

15868 Notes 

15869 ----- 

15870 Wraps ERFA function ``eraGc2gde``. The ERFA documentation is:: 

15871 

15872 - - - - - - - - - - 

15873 e r a G c 2 g d e 

15874 - - - - - - - - - - 

15875 

15876 Transform geocentric coordinates to geodetic for a reference 

15877 ellipsoid of specified form. 

15878 

15879 Given: 

15880 a double equatorial radius (Notes 2,4) 

15881 f double flattening (Note 3) 

15882 xyz double[3] geocentric vector (Note 4) 

15883 

15884 Returned: 

15885 elong double longitude (radians, east +ve) 

15886 phi double latitude (geodetic, radians) 

15887 height double height above ellipsoid (geodetic, Note 4) 

15888 

15889 Returned (function value): 

15890 int status: 0 = OK 

15891 -1 = illegal f 

15892 -2 = illegal a 

15893 

15894 Notes: 

15895 

15896 1) This function is based on the GCONV2H Fortran subroutine by 

15897 Toshio Fukushima (see reference). 

15898 

15899 2) The equatorial radius, a, can be in any units, but meters is 

15900 the conventional choice. 

15901 

15902 3) The flattening, f, is (for the Earth) a value around 0.00335, 

15903 i.e. around 1/298. 

15904 

15905 4) The equatorial radius, a, and the geocentric vector, xyz, 

15906 must be given in the same units, and determine the units of 

15907 the returned height, height. 

15908 

15909 5) If an error occurs (status < 0), elong, phi and height are 

15910 unchanged. 

15911 

15912 6) The inverse transformation is performed in the function 

15913 eraGd2gce. 

15914 

15915 7) The transformation for a standard ellipsoid (such as ERFA_WGS84) can 

15916 more conveniently be performed by calling eraGc2gd, which uses a 

15917 numerical code to identify the required A and F values. 

15918 

15919 Reference: 

15920 

15921 Fukushima, T., "Transformation from Cartesian to geodetic 

15922 coordinates accelerated by Halley's method", J.Geodesy (2006) 

15923 79: 689-693 

15924 

15925 This revision: 2021 May 11 

15926 

15927 Copyright (C) 2013-2021, NumFOCUS Foundation. 

15928 Derived, with permission, from the SOFA library. See notes at end of file. 

15929 

15930 """ 

15931 elong, phi, height, c_retval = ufunc.gc2gde(a, f, xyz) 

15932 check_errwarn(c_retval, 'gc2gde') 

15933 return elong, phi, height 

15934 

15935 

15936STATUS_CODES['gc2gde'] = { 

15937 0: 'OK', 

15938 -1: 'illegal f', 

15939 -2: 'illegal a', 

15940} 

15941 

15942 

15943def gd2gc(n, elong, phi, height): 

15944 """ 

15945 Transform geodetic coordinates to geocentric using the specified 

15946 reference ellipsoid. 

15947 

15948 Parameters 

15949 ---------- 

15950 n : int array 

15951 elong : double array 

15952 phi : double array 

15953 height : double array 

15954 

15955 Returns 

15956 ------- 

15957 xyz : double array 

15958 

15959 Notes 

15960 ----- 

15961 Wraps ERFA function ``eraGd2gc``. The ERFA documentation is:: 

15962 

15963 - - - - - - - - - 

15964 e r a G d 2 g c 

15965 - - - - - - - - - 

15966 

15967 Transform geodetic coordinates to geocentric using the specified 

15968 reference ellipsoid. 

15969 

15970 Given: 

15971 n int ellipsoid identifier (Note 1) 

15972 elong double longitude (radians, east +ve) 

15973 phi double latitude (geodetic, radians, Note 3) 

15974 height double height above ellipsoid (geodetic, Notes 2,3) 

15975 

15976 Returned: 

15977 xyz double[3] geocentric vector (Note 2) 

15978 

15979 Returned (function value): 

15980 int status: 0 = OK 

15981 -1 = illegal identifier (Note 3) 

15982 -2 = illegal case (Note 3) 

15983 

15984 Notes: 

15985 

15986 1) The identifier n is a number that specifies the choice of 

15987 reference ellipsoid. The following are supported: 

15988 

15989 n ellipsoid 

15990 

15991 1 ERFA_WGS84 

15992 2 ERFA_GRS80 

15993 3 ERFA_WGS72 

15994 

15995 The n value has no significance outside the ERFA software. For 

15996 convenience, symbols ERFA_WGS84 etc. are defined in erfam.h. 

15997 

15998 2) The height (height, given) and the geocentric vector (xyz, 

15999 returned) are in meters. 

16000 

16001 3) No validation is performed on the arguments elong, phi and 

16002 height. An error status -1 means that the identifier n is 

16003 illegal. An error status -2 protects against cases that would 

16004 lead to arithmetic exceptions. In all error cases, xyz is set 

16005 to zeros. 

16006 

16007 4) The inverse transformation is performed in the function eraGc2gd. 

16008 

16009 Called: 

16010 eraEform Earth reference ellipsoids 

16011 eraGd2gce geodetic to geocentric transformation, general 

16012 eraZp zero p-vector 

16013 

16014 This revision: 2021 May 11 

16015 

16016 Copyright (C) 2013-2021, NumFOCUS Foundation. 

16017 Derived, with permission, from the SOFA library. See notes at end of file. 

16018 

16019 """ 

16020 xyz, c_retval = ufunc.gd2gc(n, elong, phi, height) 

16021 check_errwarn(c_retval, 'gd2gc') 

16022 return xyz 

16023 

16024 

16025STATUS_CODES['gd2gc'] = { 

16026 0: 'OK', 

16027 -1: 'illegal identifier (Note 3)', 

16028 -2: 'illegal case (Note 3)', 

16029} 

16030 

16031 

16032def gd2gce(a, f, elong, phi, height): 

16033 """ 

16034 Transform geodetic coordinates to geocentric for a reference 

16035 ellipsoid of specified form. 

16036 

16037 Parameters 

16038 ---------- 

16039 a : double array 

16040 f : double array 

16041 elong : double array 

16042 phi : double array 

16043 height : double array 

16044 

16045 Returns 

16046 ------- 

16047 xyz : double array 

16048 

16049 Notes 

16050 ----- 

16051 Wraps ERFA function ``eraGd2gce``. The ERFA documentation is:: 

16052 

16053 - - - - - - - - - - 

16054 e r a G d 2 g c e 

16055 - - - - - - - - - - 

16056 

16057 Transform geodetic coordinates to geocentric for a reference 

16058 ellipsoid of specified form. 

16059 

16060 Given: 

16061 a double equatorial radius (Notes 1,4) 

16062 f double flattening (Notes 2,4) 

16063 elong double longitude (radians, east +ve) 

16064 phi double latitude (geodetic, radians, Note 4) 

16065 height double height above ellipsoid (geodetic, Notes 3,4) 

16066 

16067 Returned: 

16068 xyz double[3] geocentric vector (Note 3) 

16069 

16070 Returned (function value): 

16071 int status: 0 = OK 

16072 -1 = illegal case (Note 4) 

16073 Notes: 

16074 

16075 1) The equatorial radius, a, can be in any units, but meters is 

16076 the conventional choice. 

16077 

16078 2) The flattening, f, is (for the Earth) a value around 0.00335, 

16079 i.e. around 1/298. 

16080 

16081 3) The equatorial radius, a, and the height, height, must be 

16082 given in the same units, and determine the units of the 

16083 returned geocentric vector, xyz. 

16084 

16085 4) No validation is performed on individual arguments. The error 

16086 status -1 protects against (unrealistic) cases that would lead 

16087 to arithmetic exceptions. If an error occurs, xyz is unchanged. 

16088 

16089 5) The inverse transformation is performed in the function 

16090 eraGc2gde. 

16091 

16092 6) The transformation for a standard ellipsoid (such as ERFA_WGS84) can 

16093 more conveniently be performed by calling eraGd2gc, which uses a 

16094 numerical code to identify the required a and f values. 

16095 

16096 References: 

16097 

16098 Green, R.M., Spherical Astronomy, Cambridge University Press, 

16099 (1985) Section 4.5, p96. 

16100 

16101 Explanatory Supplement to the Astronomical Almanac, 

16102 P. Kenneth Seidelmann (ed), University Science Books (1992), 

16103 Section 4.22, p202. 

16104 

16105 This revision: 2021 May 11 

16106 

16107 Copyright (C) 2013-2021, NumFOCUS Foundation. 

16108 Derived, with permission, from the SOFA library. See notes at end of file. 

16109 

16110 """ 

16111 xyz, c_retval = ufunc.gd2gce(a, f, elong, phi, height) 

16112 check_errwarn(c_retval, 'gd2gce') 

16113 return xyz 

16114 

16115 

16116STATUS_CODES['gd2gce'] = { 

16117 0: 'OK', 

16118 -1: 'illegal case (Note 4)Notes:', 

16119} 

16120 

16121 

16122def d2dtf(scale, ndp, d1, d2): 

16123 """ 

16124 Format for output a 2-part Julian Date (or in the case of UTC a 

16125 quasi-JD form that includes special provision for leap seconds). 

16126 

16127 Parameters 

16128 ---------- 

16129 scale : const char array 

16130 ndp : int array 

16131 d1 : double array 

16132 d2 : double array 

16133 

16134 Returns 

16135 ------- 

16136 iy : int array 

16137 im : int array 

16138 id : int array 

16139 ihmsf : int array 

16140 

16141 Notes 

16142 ----- 

16143 Wraps ERFA function ``eraD2dtf``. The ERFA documentation is:: 

16144 

16145 - - - - - - - - - 

16146 e r a D 2 d t f 

16147 - - - - - - - - - 

16148 

16149 Format for output a 2-part Julian Date (or in the case of UTC a 

16150 quasi-JD form that includes special provision for leap seconds). 

16151 

16152 Given: 

16153 scale char[] time scale ID (Note 1) 

16154 ndp int resolution (Note 2) 

16155 d1,d2 double time as a 2-part Julian Date (Notes 3,4) 

16156 

16157 Returned: 

16158 iy,im,id int year, month, day in Gregorian calendar (Note 5) 

16159 ihmsf int[4] hours, minutes, seconds, fraction (Note 1) 

16160 

16161 Returned (function value): 

16162 int status: +1 = dubious year (Note 5) 

16163 0 = OK 

16164 -1 = unacceptable date (Note 6) 

16165 

16166 Notes: 

16167 

16168 1) scale identifies the time scale. Only the value "UTC" (in upper 

16169 case) is significant, and enables handling of leap seconds (see 

16170 Note 4). 

16171 

16172 2) ndp is the number of decimal places in the seconds field, and can 

16173 have negative as well as positive values, such as: 

16174 

16175 ndp resolution 

16176 -4 1 00 00 

16177 -3 0 10 00 

16178 -2 0 01 00 

16179 -1 0 00 10 

16180 0 0 00 01 

16181 1 0 00 00.1 

16182 2 0 00 00.01 

16183 3 0 00 00.001 

16184 

16185 The limits are platform dependent, but a safe range is -5 to +9. 

16186 

16187 3) d1+d2 is Julian Date, apportioned in any convenient way between 

16188 the two arguments, for example where d1 is the Julian Day Number 

16189 and d2 is the fraction of a day. In the case of UTC, where the 

16190 use of JD is problematical, special conventions apply: see the 

16191 next note. 

16192 

16193 4) JD cannot unambiguously represent UTC during a leap second unless 

16194 special measures are taken. The ERFA internal convention is that 

16195 the quasi-JD day represents UTC days whether the length is 86399, 

16196 86400 or 86401 SI seconds. In the 1960-1972 era there were 

16197 smaller jumps (in either direction) each time the linear UTC(TAI) 

16198 expression was changed, and these "mini-leaps" are also included 

16199 in the ERFA convention. 

16200 

16201 5) The warning status "dubious year" flags UTCs that predate the 

16202 introduction of the time scale or that are too far in the future 

16203 to be trusted. See eraDat for further details. 

16204 

16205 6) For calendar conventions and limitations, see eraCal2jd. 

16206 

16207 Called: 

16208 eraJd2cal JD to Gregorian calendar 

16209 eraD2tf decompose days to hms 

16210 eraDat delta(AT) = TAI-UTC 

16211 

16212 This revision: 2021 May 11 

16213 

16214 Copyright (C) 2013-2021, NumFOCUS Foundation. 

16215 Derived, with permission, from the SOFA library. See notes at end of file. 

16216 

16217 """ 

16218 iy, im, id, ihmsf, c_retval = ufunc.d2dtf(scale, ndp, d1, d2) 

16219 check_errwarn(c_retval, 'd2dtf') 

16220 return iy, im, id, ihmsf 

16221 

16222 

16223STATUS_CODES['d2dtf'] = { 

16224 1: 'dubious year (Note 5)', 

16225 0: 'OK', 

16226 -1: 'unacceptable date (Note 6)', 

16227} 

16228 

16229 

16230def dat(iy, im, id, fd): 

16231 """ 

16232 For a given UTC date, calculate Delta(AT) = TAI-UTC. 

16233 

16234 Parameters 

16235 ---------- 

16236 iy : int array 

16237 im : int array 

16238 id : int array 

16239 fd : double array 

16240 

16241 Returns 

16242 ------- 

16243 deltat : double array 

16244 

16245 Notes 

16246 ----- 

16247 Wraps ERFA function ``eraDat``. The ERFA documentation is:: 

16248 

16249 - - - - - - - 

16250 e r a D a t 

16251 - - - - - - - 

16252 

16253 For a given UTC date, calculate Delta(AT) = TAI-UTC. 

16254 

16255 :------------------------------------------: 

16256 : : 

16257 : IMPORTANT : 

16258 : : 

16259 : A new version of this function must be : 

16260 : produced whenever a new leap second is : 

16261 : announced. There are four items to : 

16262 : change on each such occasion: : 

16263 : : 

16264 : 1) A new line must be added to the set : 

16265 : of statements that initialize the : 

16266 : array "changes". : 

16267 : : 

16268 : 2) The constant IYV must be set to the : 

16269 : current year. : 

16270 : : 

16271 : 3) The "Latest leap second" comment : 

16272 : below must be set to the new leap : 

16273 : second date. : 

16274 : : 

16275 : 4) The "This revision" comment, later, : 

16276 : must be set to the current date. : 

16277 : : 

16278 : Change (2) must also be carried out : 

16279 : whenever the function is re-issued, : 

16280 : even if no leap seconds have been : 

16281 : added. : 

16282 : : 

16283 : Latest leap second: 2016 December 31 : 

16284 : : 

16285 :__________________________________________: 

16286 

16287 Given: 

16288 iy int UTC: year (Notes 1 and 2) 

16289 im int month (Note 2) 

16290 id int day (Notes 2 and 3) 

16291 fd double fraction of day (Note 4) 

16292 

16293 Returned: 

16294 deltat double TAI minus UTC, seconds 

16295 

16296 Returned (function value): 

16297 int status (Note 5): 

16298 1 = dubious year (Note 1) 

16299 0 = OK 

16300 -1 = bad year 

16301 -2 = bad month 

16302 -3 = bad day (Note 3) 

16303 -4 = bad fraction (Note 4) 

16304 -5 = internal error (Note 5) 

16305 

16306 Notes: 

16307 

16308 1) UTC began at 1960 January 1.0 (JD 2436934.5) and it is improper 

16309 to call the function with an earlier date. If this is attempted, 

16310 zero is returned together with a warning status. 

16311 

16312 Because leap seconds cannot, in principle, be predicted in 

16313 advance, a reliable check for dates beyond the valid range is 

16314 impossible. To guard against gross errors, a year five or more 

16315 after the release year of the present function (see the constant 

16316 IYV) is considered dubious. In this case a warning status is 

16317 returned but the result is computed in the normal way. 

16318 

16319 For both too-early and too-late years, the warning status is +1. 

16320 This is distinct from the error status -1, which signifies a year 

16321 so early that JD could not be computed. 

16322 

16323 2) If the specified date is for a day which ends with a leap second, 

16324 the TAI-UTC value returned is for the period leading up to the 

16325 leap second. If the date is for a day which begins as a leap 

16326 second ends, the TAI-UTC returned is for the period following the 

16327 leap second. 

16328 

16329 3) The day number must be in the normal calendar range, for example 

16330 1 through 30 for April. The "almanac" convention of allowing 

16331 such dates as January 0 and December 32 is not supported in this 

16332 function, in order to avoid confusion near leap seconds. 

16333 

16334 4) The fraction of day is used only for dates before the 

16335 introduction of leap seconds, the first of which occurred at the 

16336 end of 1971. It is tested for validity (0 to 1 is the valid 

16337 range) even if not used; if invalid, zero is used and status -4 

16338 is returned. For many applications, setting fd to zero is 

16339 acceptable; the resulting error is always less than 3 ms (and 

16340 occurs only pre-1972). 

16341 

16342 5) The status value returned in the case where there are multiple 

16343 errors refers to the first error detected. For example, if the 

16344 month and day are 13 and 32 respectively, status -2 (bad month) 

16345 will be returned. The "internal error" status refers to a 

16346 case that is impossible but causes some compilers to issue a 

16347 warning. 

16348 

16349 6) In cases where a valid result is not available, zero is returned. 

16350 

16351 References: 

16352 

16353 1) For dates from 1961 January 1 onwards, the expressions from the 

16354 file ftp://maia.usno.navy.mil/ser7/tai-utc.dat are used. 

16355 

16356 2) The 5ms timestep at 1961 January 1 is taken from 2.58.1 (p87) of 

16357 the 1992 Explanatory Supplement. 

16358 

16359 Called: 

16360 eraCal2jd Gregorian calendar to JD 

16361 

16362 This revision: 2021 May 11 

16363 

16364 Copyright (C) 2013-2021, NumFOCUS Foundation. 

16365 Derived, with permission, from the SOFA library. See notes at end of file. 

16366 

16367 """ 

16368 deltat, c_retval = ufunc.dat(iy, im, id, fd) 

16369 check_errwarn(c_retval, 'dat') 

16370 return deltat 

16371 

16372 

16373STATUS_CODES['dat'] = { 

16374 1: 'dubious year (Note 1)', 

16375 0: 'OK', 

16376 -1: 'bad year', 

16377 -2: 'bad month', 

16378 -3: 'bad day (Note 3)', 

16379 -4: 'bad fraction (Note 4)', 

16380 -5: 'internal error (Note 5)', 

16381} 

16382 

16383 

16384def dtdb(date1, date2, ut, elong, u, v): 

16385 """ 

16386 An approximation to TDB-TT, the difference between barycentric 

16387 dynamical time and terrestrial time, for an observer on the Earth. 

16388 

16389 Parameters 

16390 ---------- 

16391 date1 : double array 

16392 date2 : double array 

16393 ut : double array 

16394 elong : double array 

16395 u : double array 

16396 v : double array 

16397 

16398 Returns 

16399 ------- 

16400 c_retval : double array 

16401 

16402 Notes 

16403 ----- 

16404 Wraps ERFA function ``eraDtdb``. The ERFA documentation is:: 

16405 

16406 - - - - - - - - 

16407 e r a D t d b 

16408 - - - - - - - - 

16409 

16410 An approximation to TDB-TT, the difference between barycentric 

16411 dynamical time and terrestrial time, for an observer on the Earth. 

16412 

16413 The different time scales - proper, coordinate and realized - are 

16414 related to each other: 

16415 

16416 TAI <- physically realized 

16417 : 

16418 offset <- observed (nominally +32.184s) 

16419 : 

16420 TT <- terrestrial time 

16421 : 

16422 rate adjustment (L_G) <- definition of TT 

16423 : 

16424 TCG <- time scale for GCRS 

16425 : 

16426 "periodic" terms <- eraDtdb is an implementation 

16427 : 

16428 rate adjustment (L_C) <- function of solar-system ephemeris 

16429 : 

16430 TCB <- time scale for BCRS 

16431 : 

16432 rate adjustment (-L_B) <- definition of TDB 

16433 : 

16434 TDB <- TCB scaled to track TT 

16435 : 

16436 "periodic" terms <- -eraDtdb is an approximation 

16437 : 

16438 TT <- terrestrial time 

16439 

16440 Adopted values for the various constants can be found in the IERS 

16441 Conventions (McCarthy & Petit 2003). 

16442 

16443 Given: 

16444 date1,date2 double date, TDB (Notes 1-3) 

16445 ut double universal time (UT1, fraction of one day) 

16446 elong double longitude (east positive, radians) 

16447 u double distance from Earth spin axis (km) 

16448 v double distance north of equatorial plane (km) 

16449 

16450 Returned (function value): 

16451 double TDB-TT (seconds) 

16452 

16453 Notes: 

16454 

16455 1) The date date1+date2 is a Julian Date, apportioned in any 

16456 convenient way between the two arguments. For example, 

16457 JD(TT)=2450123.7 could be expressed in any of these ways, 

16458 among others: 

16459 

16460 date1 date2 

16461 

16462 2450123.7 0.0 (JD method) 

16463 2451545.0 -1421.3 (J2000 method) 

16464 2400000.5 50123.2 (MJD method) 

16465 2450123.5 0.2 (date & time method) 

16466 

16467 The JD method is the most natural and convenient to use in 

16468 cases where the loss of several decimal digits of resolution 

16469 is acceptable. The J2000 method is best matched to the way 

16470 the argument is handled internally and will deliver the 

16471 optimum resolution. The MJD method and the date & time methods 

16472 are both good compromises between resolution and convenience. 

16473 

16474 Although the date is, formally, barycentric dynamical time (TDB), 

16475 the terrestrial dynamical time (TT) can be used with no practical 

16476 effect on the accuracy of the prediction. 

16477 

16478 2) TT can be regarded as a coordinate time that is realized as an 

16479 offset of 32.184s from International Atomic Time, TAI. TT is a 

16480 specific linear transformation of geocentric coordinate time TCG, 

16481 which is the time scale for the Geocentric Celestial Reference 

16482 System, GCRS. 

16483 

16484 3) TDB is a coordinate time, and is a specific linear transformation 

16485 of barycentric coordinate time TCB, which is the time scale for 

16486 the Barycentric Celestial Reference System, BCRS. 

16487 

16488 4) The difference TCG-TCB depends on the masses and positions of the 

16489 bodies of the solar system and the velocity of the Earth. It is 

16490 dominated by a rate difference, the residual being of a periodic 

16491 character. The latter, which is modeled by the present function, 

16492 comprises a main (annual) sinusoidal term of amplitude 

16493 approximately 0.00166 seconds, plus planetary terms up to about 

16494 20 microseconds, and lunar and diurnal terms up to 2 microseconds. 

16495 These effects come from the changing transverse Doppler effect 

16496 and gravitational red-shift as the observer (on the Earth's 

16497 surface) experiences variations in speed (with respect to the 

16498 BCRS) and gravitational potential. 

16499 

16500 5) TDB can be regarded as the same as TCB but with a rate adjustment 

16501 to keep it close to TT, which is convenient for many applications. 

16502 The history of successive attempts to define TDB is set out in 

16503 Resolution 3 adopted by the IAU General Assembly in 2006, which 

16504 defines a fixed TDB(TCB) transformation that is consistent with 

16505 contemporary solar-system ephemerides. Future ephemerides will 

16506 imply slightly changed transformations between TCG and TCB, which 

16507 could introduce a linear drift between TDB and TT; however, any 

16508 such drift is unlikely to exceed 1 nanosecond per century. 

16509 

16510 6) The geocentric TDB-TT model used in the present function is that of 

16511 Fairhead & Bretagnon (1990), in its full form. It was originally 

16512 supplied by Fairhead (private communications with P.T.Wallace, 

16513 1990) as a Fortran subroutine. The present C function contains an 

16514 adaptation of the Fairhead code. The numerical results are 

16515 essentially unaffected by the changes, the differences with 

16516 respect to the Fairhead & Bretagnon original being at the 1e-20 s 

16517 level. 

16518 

16519 The topocentric part of the model is from Moyer (1981) and 

16520 Murray (1983), with fundamental arguments adapted from 

16521 Simon et al. 1994. It is an approximation to the expression 

16522 ( v / c ) . ( r / c ), where v is the barycentric velocity of 

16523 the Earth, r is the geocentric position of the observer and 

16524 c is the speed of light. 

16525 

16526 By supplying zeroes for u and v, the topocentric part of the 

16527 model can be nullified, and the function will return the Fairhead 

16528 & Bretagnon result alone. 

16529 

16530 7) During the interval 1950-2050, the absolute accuracy is better 

16531 than +/- 3 nanoseconds relative to time ephemerides obtained by 

16532 direct numerical integrations based on the JPL DE405 solar system 

16533 ephemeris. 

16534 

16535 8) It must be stressed that the present function is merely a model, 

16536 and that numerical integration of solar-system ephemerides is the 

16537 definitive method for predicting the relationship between TCG and 

16538 TCB and hence between TT and TDB. 

16539 

16540 References: 

16541 

16542 Fairhead, L., & Bretagnon, P., Astron.Astrophys., 229, 240-247 

16543 (1990). 

16544 

16545 IAU 2006 Resolution 3. 

16546 

16547 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

16548 IERS Technical Note No. 32, BKG (2004) 

16549 

16550 Moyer, T.D., Cel.Mech., 23, 33 (1981). 

16551 

16552 Murray, C.A., Vectorial Astrometry, Adam Hilger (1983). 

16553 

16554 Seidelmann, P.K. et al., Explanatory Supplement to the 

16555 Astronomical Almanac, Chapter 2, University Science Books (1992). 

16556 

16557 Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M., 

16558 Francou, G. & Laskar, J., Astron.Astrophys., 282, 663-683 (1994). 

16559 

16560 This revision: 2021 May 11 

16561 

16562 Copyright (C) 2013-2021, NumFOCUS Foundation. 

16563 Derived, with permission, from the SOFA library. See notes at end of file. 

16564 

16565 """ 

16566 c_retval = ufunc.dtdb(date1, date2, ut, elong, u, v) 

16567 return c_retval 

16568 

16569 

16570def dtf2d(scale, iy, im, id, ihr, imn, sec): 

16571 """ 

16572 Encode date and time fields into 2-part Julian Date (or in the case 

16573 of UTC a quasi-JD form that includes special provision for leap 

16574 seconds). 

16575 

16576 Parameters 

16577 ---------- 

16578 scale : const char array 

16579 iy : int array 

16580 im : int array 

16581 id : int array 

16582 ihr : int array 

16583 imn : int array 

16584 sec : double array 

16585 

16586 Returns 

16587 ------- 

16588 d1 : double array 

16589 d2 : double array 

16590 

16591 Notes 

16592 ----- 

16593 Wraps ERFA function ``eraDtf2d``. The ERFA documentation is:: 

16594 

16595 - - - - - - - - - 

16596 e r a D t f 2 d 

16597 - - - - - - - - - 

16598 

16599 Encode date and time fields into 2-part Julian Date (or in the case 

16600 of UTC a quasi-JD form that includes special provision for leap 

16601 seconds). 

16602 

16603 Given: 

16604 scale char[] time scale ID (Note 1) 

16605 iy,im,id int year, month, day in Gregorian calendar (Note 2) 

16606 ihr,imn int hour, minute 

16607 sec double seconds 

16608 

16609 Returned: 

16610 d1,d2 double 2-part Julian Date (Notes 3,4) 

16611 

16612 Returned (function value): 

16613 int status: +3 = both of next two 

16614 +2 = time is after end of day (Note 5) 

16615 +1 = dubious year (Note 6) 

16616 0 = OK 

16617 -1 = bad year 

16618 -2 = bad month 

16619 -3 = bad day 

16620 -4 = bad hour 

16621 -5 = bad minute 

16622 -6 = bad second (<0) 

16623 

16624 Notes: 

16625 

16626 1) scale identifies the time scale. Only the value "UTC" (in upper 

16627 case) is significant, and enables handling of leap seconds (see 

16628 Note 4). 

16629 

16630 2) For calendar conventions and limitations, see eraCal2jd. 

16631 

16632 3) The sum of the results, d1+d2, is Julian Date, where normally d1 

16633 is the Julian Day Number and d2 is the fraction of a day. In the 

16634 case of UTC, where the use of JD is problematical, special 

16635 conventions apply: see the next note. 

16636 

16637 4) JD cannot unambiguously represent UTC during a leap second unless 

16638 special measures are taken. The ERFA internal convention is that 

16639 the quasi-JD day represents UTC days whether the length is 86399, 

16640 86400 or 86401 SI seconds. In the 1960-1972 era there were 

16641 smaller jumps (in either direction) each time the linear UTC(TAI) 

16642 expression was changed, and these "mini-leaps" are also included 

16643 in the ERFA convention. 

16644 

16645 5) The warning status "time is after end of day" usually means that 

16646 the sec argument is greater than 60.0. However, in a day ending 

16647 in a leap second the limit changes to 61.0 (or 59.0 in the case 

16648 of a negative leap second). 

16649 

16650 6) The warning status "dubious year" flags UTCs that predate the 

16651 introduction of the time scale or that are too far in the future 

16652 to be trusted. See eraDat for further details. 

16653 

16654 7) Only in the case of continuous and regular time scales (TAI, TT, 

16655 TCG, TCB and TDB) is the result d1+d2 a Julian Date, strictly 

16656 speaking. In the other cases (UT1 and UTC) the result must be 

16657 used with circumspection; in particular the difference between 

16658 two such results cannot be interpreted as a precise time 

16659 interval. 

16660 

16661 Called: 

16662 eraCal2jd Gregorian calendar to JD 

16663 eraDat delta(AT) = TAI-UTC 

16664 eraJd2cal JD to Gregorian calendar 

16665 

16666 This revision: 2021 May 11 

16667 

16668 Copyright (C) 2013-2021, NumFOCUS Foundation. 

16669 Derived, with permission, from the SOFA library. See notes at end of file. 

16670 

16671 """ 

16672 d1, d2, c_retval = ufunc.dtf2d(scale, iy, im, id, ihr, imn, sec) 

16673 check_errwarn(c_retval, 'dtf2d') 

16674 return d1, d2 

16675 

16676 

16677STATUS_CODES['dtf2d'] = { 

16678 3: 'both of next two', 

16679 2: 'time is after end of day (Note 5)', 

16680 1: 'dubious year (Note 6)', 

16681 0: 'OK', 

16682 -1: 'bad year', 

16683 -2: 'bad month', 

16684 -3: 'bad day', 

16685 -4: 'bad hour', 

16686 -5: 'bad minute', 

16687 -6: 'bad second (<0)', 

16688} 

16689 

16690 

16691def taitt(tai1, tai2): 

16692 """ 

16693 Time scale transformation: International Atomic Time, TAI, to 

16694 Terrestrial Time, TT. 

16695 

16696 Parameters 

16697 ---------- 

16698 tai1 : double array 

16699 tai2 : double array 

16700 

16701 Returns 

16702 ------- 

16703 tt1 : double array 

16704 tt2 : double array 

16705 

16706 Notes 

16707 ----- 

16708 Wraps ERFA function ``eraTaitt``. The ERFA documentation is:: 

16709 

16710 - - - - - - - - - 

16711 e r a T a i t t 

16712 - - - - - - - - - 

16713 

16714 Time scale transformation: International Atomic Time, TAI, to 

16715 Terrestrial Time, TT. 

16716 

16717 Given: 

16718 tai1,tai2 double TAI as a 2-part Julian Date 

16719 

16720 Returned: 

16721 tt1,tt2 double TT as a 2-part Julian Date 

16722 

16723 Returned (function value): 

16724 int status: 0 = OK 

16725 

16726 Note: 

16727 

16728 tai1+tai2 is Julian Date, apportioned in any convenient way 

16729 between the two arguments, for example where tai1 is the Julian 

16730 Day Number and tai2 is the fraction of a day. The returned 

16731 tt1,tt2 follow suit. 

16732 

16733 References: 

16734 

16735 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

16736 IERS Technical Note No. 32, BKG (2004) 

16737 

16738 Explanatory Supplement to the Astronomical Almanac, 

16739 P. Kenneth Seidelmann (ed), University Science Books (1992) 

16740 

16741 This revision: 2021 May 11 

16742 

16743 Copyright (C) 2013-2021, NumFOCUS Foundation. 

16744 Derived, with permission, from the SOFA library. See notes at end of file. 

16745 

16746 """ 

16747 tt1, tt2, c_retval = ufunc.taitt(tai1, tai2) 

16748 check_errwarn(c_retval, 'taitt') 

16749 return tt1, tt2 

16750 

16751 

16752STATUS_CODES['taitt'] = { 

16753 0: 'OK', 

16754} 

16755 

16756 

16757def taiut1(tai1, tai2, dta): 

16758 """ 

16759 Time scale transformation: International Atomic Time, TAI, to 

16760 Universal Time, UT1. 

16761 

16762 Parameters 

16763 ---------- 

16764 tai1 : double array 

16765 tai2 : double array 

16766 dta : double array 

16767 

16768 Returns 

16769 ------- 

16770 ut11 : double array 

16771 ut12 : double array 

16772 

16773 Notes 

16774 ----- 

16775 Wraps ERFA function ``eraTaiut1``. The ERFA documentation is:: 

16776 

16777 - - - - - - - - - - 

16778 e r a T a i u t 1 

16779 - - - - - - - - - - 

16780 

16781 Time scale transformation: International Atomic Time, TAI, to 

16782 Universal Time, UT1. 

16783 

16784 Given: 

16785 tai1,tai2 double TAI as a 2-part Julian Date 

16786 dta double UT1-TAI in seconds 

16787 

16788 Returned: 

16789 ut11,ut12 double UT1 as a 2-part Julian Date 

16790 

16791 Returned (function value): 

16792 int status: 0 = OK 

16793 

16794 Notes: 

16795 

16796 1) tai1+tai2 is Julian Date, apportioned in any convenient way 

16797 between the two arguments, for example where tai1 is the Julian 

16798 Day Number and tai2 is the fraction of a day. The returned 

16799 UT11,UT12 follow suit. 

16800 

16801 2) The argument dta, i.e. UT1-TAI, is an observed quantity, and is 

16802 available from IERS tabulations. 

16803 

16804 Reference: 

16805 

16806 Explanatory Supplement to the Astronomical Almanac, 

16807 P. Kenneth Seidelmann (ed), University Science Books (1992) 

16808 

16809 This revision: 2021 May 11 

16810 

16811 Copyright (C) 2013-2021, NumFOCUS Foundation. 

16812 Derived, with permission, from the SOFA library. See notes at end of file. 

16813 

16814 """ 

16815 ut11, ut12, c_retval = ufunc.taiut1(tai1, tai2, dta) 

16816 check_errwarn(c_retval, 'taiut1') 

16817 return ut11, ut12 

16818 

16819 

16820STATUS_CODES['taiut1'] = { 

16821 0: 'OK', 

16822} 

16823 

16824 

16825def taiutc(tai1, tai2): 

16826 """ 

16827 Time scale transformation: International Atomic Time, TAI, to 

16828 Coordinated Universal Time, UTC. 

16829 

16830 Parameters 

16831 ---------- 

16832 tai1 : double array 

16833 tai2 : double array 

16834 

16835 Returns 

16836 ------- 

16837 utc1 : double array 

16838 utc2 : double array 

16839 

16840 Notes 

16841 ----- 

16842 Wraps ERFA function ``eraTaiutc``. The ERFA documentation is:: 

16843 

16844 - - - - - - - - - - 

16845 e r a T a i u t c 

16846 - - - - - - - - - - 

16847 

16848 Time scale transformation: International Atomic Time, TAI, to 

16849 Coordinated Universal Time, UTC. 

16850 

16851 Given: 

16852 tai1,tai2 double TAI as a 2-part Julian Date (Note 1) 

16853 

16854 Returned: 

16855 utc1,utc2 double UTC as a 2-part quasi Julian Date (Notes 1-3) 

16856 

16857 Returned (function value): 

16858 int status: +1 = dubious year (Note 4) 

16859 0 = OK 

16860 -1 = unacceptable date 

16861 

16862 Notes: 

16863 

16864 1) tai1+tai2 is Julian Date, apportioned in any convenient way 

16865 between the two arguments, for example where tai1 is the Julian 

16866 Day Number and tai2 is the fraction of a day. The returned utc1 

16867 and utc2 form an analogous pair, except that a special convention 

16868 is used, to deal with the problem of leap seconds - see the next 

16869 note. 

16870 

16871 2) JD cannot unambiguously represent UTC during a leap second unless 

16872 special measures are taken. The convention in the present 

16873 function is that the JD day represents UTC days whether the 

16874 length is 86399, 86400 or 86401 SI seconds. In the 1960-1972 era 

16875 there were smaller jumps (in either direction) each time the 

16876 linear UTC(TAI) expression was changed, and these "mini-leaps" 

16877 are also included in the ERFA convention. 

16878 

16879 3) The function eraD2dtf can be used to transform the UTC quasi-JD 

16880 into calendar date and clock time, including UTC leap second 

16881 handling. 

16882 

16883 4) The warning status "dubious year" flags UTCs that predate the 

16884 introduction of the time scale or that are too far in the future 

16885 to be trusted. See eraDat for further details. 

16886 

16887 Called: 

16888 eraUtctai UTC to TAI 

16889 

16890 References: 

16891 

16892 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

16893 IERS Technical Note No. 32, BKG (2004) 

16894 

16895 Explanatory Supplement to the Astronomical Almanac, 

16896 P. Kenneth Seidelmann (ed), University Science Books (1992) 

16897 

16898 This revision: 2021 May 11 

16899 

16900 Copyright (C) 2013-2021, NumFOCUS Foundation. 

16901 Derived, with permission, from the SOFA library. See notes at end of file. 

16902 

16903 """ 

16904 utc1, utc2, c_retval = ufunc.taiutc(tai1, tai2) 

16905 check_errwarn(c_retval, 'taiutc') 

16906 return utc1, utc2 

16907 

16908 

16909STATUS_CODES['taiutc'] = { 

16910 1: 'dubious year (Note 4)', 

16911 0: 'OK', 

16912 -1: 'unacceptable date', 

16913} 

16914 

16915 

16916def tcbtdb(tcb1, tcb2): 

16917 """ 

16918 Time scale transformation: Barycentric Coordinate Time, TCB, to 

16919 Barycentric Dynamical Time, TDB. 

16920 

16921 Parameters 

16922 ---------- 

16923 tcb1 : double array 

16924 tcb2 : double array 

16925 

16926 Returns 

16927 ------- 

16928 tdb1 : double array 

16929 tdb2 : double array 

16930 

16931 Notes 

16932 ----- 

16933 Wraps ERFA function ``eraTcbtdb``. The ERFA documentation is:: 

16934 

16935 - - - - - - - - - - 

16936 e r a T c b t d b 

16937 - - - - - - - - - - 

16938 

16939 Time scale transformation: Barycentric Coordinate Time, TCB, to 

16940 Barycentric Dynamical Time, TDB. 

16941 

16942 Given: 

16943 tcb1,tcb2 double TCB as a 2-part Julian Date 

16944 

16945 Returned: 

16946 tdb1,tdb2 double TDB as a 2-part Julian Date 

16947 

16948 Returned (function value): 

16949 int status: 0 = OK 

16950 

16951 Notes: 

16952 

16953 1) tcb1+tcb2 is Julian Date, apportioned in any convenient way 

16954 between the two arguments, for example where tcb1 is the Julian 

16955 Day Number and tcb2 is the fraction of a day. The returned 

16956 tdb1,tdb2 follow suit. 

16957 

16958 2) The 2006 IAU General Assembly introduced a conventional linear 

16959 transformation between TDB and TCB. This transformation 

16960 compensates for the drift between TCB and terrestrial time TT, 

16961 and keeps TDB approximately centered on TT. Because the 

16962 relationship between TT and TCB depends on the adopted solar 

16963 system ephemeris, the degree of alignment between TDB and TT over 

16964 long intervals will vary according to which ephemeris is used. 

16965 Former definitions of TDB attempted to avoid this problem by 

16966 stipulating that TDB and TT should differ only by periodic 

16967 effects. This is a good description of the nature of the 

16968 relationship but eluded precise mathematical formulation. The 

16969 conventional linear relationship adopted in 2006 sidestepped 

16970 these difficulties whilst delivering a TDB that in practice was 

16971 consistent with values before that date. 

16972 

16973 3) TDB is essentially the same as Teph, the time argument for the 

16974 JPL solar system ephemerides. 

16975 

16976 Reference: 

16977 

16978 IAU 2006 Resolution B3 

16979 

16980 This revision: 2021 May 11 

16981 

16982 Copyright (C) 2013-2021, NumFOCUS Foundation. 

16983 Derived, with permission, from the SOFA library. See notes at end of file. 

16984 

16985 """ 

16986 tdb1, tdb2, c_retval = ufunc.tcbtdb(tcb1, tcb2) 

16987 check_errwarn(c_retval, 'tcbtdb') 

16988 return tdb1, tdb2 

16989 

16990 

16991STATUS_CODES['tcbtdb'] = { 

16992 0: 'OK', 

16993} 

16994 

16995 

16996def tcgtt(tcg1, tcg2): 

16997 """ 

16998 Time scale transformation: Geocentric Coordinate Time, TCG, to 

16999 Terrestrial Time, TT. 

17000 

17001 Parameters 

17002 ---------- 

17003 tcg1 : double array 

17004 tcg2 : double array 

17005 

17006 Returns 

17007 ------- 

17008 tt1 : double array 

17009 tt2 : double array 

17010 

17011 Notes 

17012 ----- 

17013 Wraps ERFA function ``eraTcgtt``. The ERFA documentation is:: 

17014 

17015 - - - - - - - - - 

17016 e r a T c g t t 

17017 - - - - - - - - - 

17018 

17019 Time scale transformation: Geocentric Coordinate Time, TCG, to 

17020 Terrestrial Time, TT. 

17021 

17022 Given: 

17023 tcg1,tcg2 double TCG as a 2-part Julian Date 

17024 

17025 Returned: 

17026 tt1,tt2 double TT as a 2-part Julian Date 

17027 

17028 Returned (function value): 

17029 int status: 0 = OK 

17030 

17031 Note: 

17032 

17033 tcg1+tcg2 is Julian Date, apportioned in any convenient way 

17034 between the two arguments, for example where tcg1 is the Julian 

17035 Day Number and tcg22 is the fraction of a day. The returned 

17036 tt1,tt2 follow suit. 

17037 

17038 References: 

17039 

17040 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

17041 IERS Technical Note No. 32, BKG (2004) 

17042 

17043 IAU 2000 Resolution B1.9 

17044 

17045 This revision: 2021 May 11 

17046 

17047 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17048 Derived, with permission, from the SOFA library. See notes at end of file. 

17049 

17050 """ 

17051 tt1, tt2, c_retval = ufunc.tcgtt(tcg1, tcg2) 

17052 check_errwarn(c_retval, 'tcgtt') 

17053 return tt1, tt2 

17054 

17055 

17056STATUS_CODES['tcgtt'] = { 

17057 0: 'OK', 

17058} 

17059 

17060 

17061def tdbtcb(tdb1, tdb2): 

17062 """ 

17063 Time scale transformation: Barycentric Dynamical Time, TDB, to 

17064 Barycentric Coordinate Time, TCB. 

17065 

17066 Parameters 

17067 ---------- 

17068 tdb1 : double array 

17069 tdb2 : double array 

17070 

17071 Returns 

17072 ------- 

17073 tcb1 : double array 

17074 tcb2 : double array 

17075 

17076 Notes 

17077 ----- 

17078 Wraps ERFA function ``eraTdbtcb``. The ERFA documentation is:: 

17079 

17080 - - - - - - - - - - 

17081 e r a T d b t c b 

17082 - - - - - - - - - - 

17083 

17084 Time scale transformation: Barycentric Dynamical Time, TDB, to 

17085 Barycentric Coordinate Time, TCB. 

17086 

17087 Given: 

17088 tdb1,tdb2 double TDB as a 2-part Julian Date 

17089 

17090 Returned: 

17091 tcb1,tcb2 double TCB as a 2-part Julian Date 

17092 

17093 Returned (function value): 

17094 int status: 0 = OK 

17095 

17096 Notes: 

17097 

17098 1) tdb1+tdb2 is Julian Date, apportioned in any convenient way 

17099 between the two arguments, for example where tdb1 is the Julian 

17100 Day Number and tdb2 is the fraction of a day. The returned 

17101 tcb1,tcb2 follow suit. 

17102 

17103 2) The 2006 IAU General Assembly introduced a conventional linear 

17104 transformation between TDB and TCB. This transformation 

17105 compensates for the drift between TCB and terrestrial time TT, 

17106 and keeps TDB approximately centered on TT. Because the 

17107 relationship between TT and TCB depends on the adopted solar 

17108 system ephemeris, the degree of alignment between TDB and TT over 

17109 long intervals will vary according to which ephemeris is used. 

17110 Former definitions of TDB attempted to avoid this problem by 

17111 stipulating that TDB and TT should differ only by periodic 

17112 effects. This is a good description of the nature of the 

17113 relationship but eluded precise mathematical formulation. The 

17114 conventional linear relationship adopted in 2006 sidestepped 

17115 these difficulties whilst delivering a TDB that in practice was 

17116 consistent with values before that date. 

17117 

17118 3) TDB is essentially the same as Teph, the time argument for the 

17119 JPL solar system ephemerides. 

17120 

17121 Reference: 

17122 

17123 IAU 2006 Resolution B3 

17124 

17125 This revision: 2021 May 11 

17126 

17127 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17128 Derived, with permission, from the SOFA library. See notes at end of file. 

17129 

17130 """ 

17131 tcb1, tcb2, c_retval = ufunc.tdbtcb(tdb1, tdb2) 

17132 check_errwarn(c_retval, 'tdbtcb') 

17133 return tcb1, tcb2 

17134 

17135 

17136STATUS_CODES['tdbtcb'] = { 

17137 0: 'OK', 

17138} 

17139 

17140 

17141def tdbtt(tdb1, tdb2, dtr): 

17142 """ 

17143 Time scale transformation: Barycentric Dynamical Time, TDB, to 

17144 Terrestrial Time, TT. 

17145 

17146 Parameters 

17147 ---------- 

17148 tdb1 : double array 

17149 tdb2 : double array 

17150 dtr : double array 

17151 

17152 Returns 

17153 ------- 

17154 tt1 : double array 

17155 tt2 : double array 

17156 

17157 Notes 

17158 ----- 

17159 Wraps ERFA function ``eraTdbtt``. The ERFA documentation is:: 

17160 

17161 - - - - - - - - - 

17162 e r a T d b t t 

17163 - - - - - - - - - 

17164 

17165 Time scale transformation: Barycentric Dynamical Time, TDB, to 

17166 Terrestrial Time, TT. 

17167 

17168 Given: 

17169 tdb1,tdb2 double TDB as a 2-part Julian Date 

17170 dtr double TDB-TT in seconds 

17171 

17172 Returned: 

17173 tt1,tt2 double TT as a 2-part Julian Date 

17174 

17175 Returned (function value): 

17176 int status: 0 = OK 

17177 

17178 Notes: 

17179 

17180 1) tdb1+tdb2 is Julian Date, apportioned in any convenient way 

17181 between the two arguments, for example where tdb1 is the Julian 

17182 Day Number and tdb2 is the fraction of a day. The returned 

17183 tt1,tt2 follow suit. 

17184 

17185 2) The argument dtr represents the quasi-periodic component of the 

17186 GR transformation between TT and TCB. It is dependent upon the 

17187 adopted solar-system ephemeris, and can be obtained by numerical 

17188 integration, by interrogating a precomputed time ephemeris or by 

17189 evaluating a model such as that implemented in the ERFA function 

17190 eraDtdb. The quantity is dominated by an annual term of 1.7 ms 

17191 amplitude. 

17192 

17193 3) TDB is essentially the same as Teph, the time argument for the 

17194 JPL solar system ephemerides. 

17195 

17196 References: 

17197 

17198 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

17199 IERS Technical Note No. 32, BKG (2004) 

17200 

17201 IAU 2006 Resolution 3 

17202 

17203 This revision: 2021 May 11 

17204 

17205 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17206 Derived, with permission, from the SOFA library. See notes at end of file. 

17207 

17208 """ 

17209 tt1, tt2, c_retval = ufunc.tdbtt(tdb1, tdb2, dtr) 

17210 check_errwarn(c_retval, 'tdbtt') 

17211 return tt1, tt2 

17212 

17213 

17214STATUS_CODES['tdbtt'] = { 

17215 0: 'OK', 

17216} 

17217 

17218 

17219def tttai(tt1, tt2): 

17220 """ 

17221 Time scale transformation: Terrestrial Time, TT, to International 

17222 Atomic Time, TAI. 

17223 

17224 Parameters 

17225 ---------- 

17226 tt1 : double array 

17227 tt2 : double array 

17228 

17229 Returns 

17230 ------- 

17231 tai1 : double array 

17232 tai2 : double array 

17233 

17234 Notes 

17235 ----- 

17236 Wraps ERFA function ``eraTttai``. The ERFA documentation is:: 

17237 

17238 - - - - - - - - - 

17239 e r a T t t a i 

17240 - - - - - - - - - 

17241 

17242 Time scale transformation: Terrestrial Time, TT, to International 

17243 Atomic Time, TAI. 

17244 

17245 Given: 

17246 tt1,tt2 double TT as a 2-part Julian Date 

17247 

17248 Returned: 

17249 tai1,tai2 double TAI as a 2-part Julian Date 

17250 

17251 Returned (function value): 

17252 int status: 0 = OK 

17253 

17254 Note: 

17255 

17256 tt1+tt2 is Julian Date, apportioned in any convenient way between 

17257 the two arguments, for example where tt1 is the Julian Day Number 

17258 and tt2 is the fraction of a day. The returned tai1,tai2 follow 

17259 suit. 

17260 

17261 References: 

17262 

17263 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

17264 IERS Technical Note No. 32, BKG (2004) 

17265 

17266 Explanatory Supplement to the Astronomical Almanac, 

17267 P. Kenneth Seidelmann (ed), University Science Books (1992) 

17268 

17269 This revision: 2021 May 11 

17270 

17271 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17272 Derived, with permission, from the SOFA library. See notes at end of file. 

17273 

17274 """ 

17275 tai1, tai2, c_retval = ufunc.tttai(tt1, tt2) 

17276 check_errwarn(c_retval, 'tttai') 

17277 return tai1, tai2 

17278 

17279 

17280STATUS_CODES['tttai'] = { 

17281 0: 'OK', 

17282} 

17283 

17284 

17285def tttcg(tt1, tt2): 

17286 """ 

17287 Time scale transformation: Terrestrial Time, TT, to Geocentric 

17288 Coordinate Time, TCG. 

17289 

17290 Parameters 

17291 ---------- 

17292 tt1 : double array 

17293 tt2 : double array 

17294 

17295 Returns 

17296 ------- 

17297 tcg1 : double array 

17298 tcg2 : double array 

17299 

17300 Notes 

17301 ----- 

17302 Wraps ERFA function ``eraTttcg``. The ERFA documentation is:: 

17303 

17304 - - - - - - - - - 

17305 e r a T t t c g 

17306 - - - - - - - - - 

17307 

17308 Time scale transformation: Terrestrial Time, TT, to Geocentric 

17309 Coordinate Time, TCG. 

17310 

17311 Given: 

17312 tt1,tt2 double TT as a 2-part Julian Date 

17313 

17314 Returned: 

17315 tcg1,tcg2 double TCG as a 2-part Julian Date 

17316 

17317 Returned (function value): 

17318 int status: 0 = OK 

17319 

17320 Note: 

17321 

17322 tt1+tt2 is Julian Date, apportioned in any convenient way between 

17323 the two arguments, for example where tt1 is the Julian Day Number 

17324 and tt2 is the fraction of a day. The returned tcg1,tcg2 follow 

17325 suit. 

17326 

17327 References: 

17328 

17329 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

17330 IERS Technical Note No. 32, BKG (2004) 

17331 

17332 IAU 2000 Resolution B1.9 

17333 

17334 This revision: 2021 May 11 

17335 

17336 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17337 Derived, with permission, from the SOFA library. See notes at end of file. 

17338 

17339 """ 

17340 tcg1, tcg2, c_retval = ufunc.tttcg(tt1, tt2) 

17341 check_errwarn(c_retval, 'tttcg') 

17342 return tcg1, tcg2 

17343 

17344 

17345STATUS_CODES['tttcg'] = { 

17346 0: 'OK', 

17347} 

17348 

17349 

17350def tttdb(tt1, tt2, dtr): 

17351 """ 

17352 Time scale transformation: Terrestrial Time, TT, to Barycentric 

17353 Dynamical Time, TDB. 

17354 

17355 Parameters 

17356 ---------- 

17357 tt1 : double array 

17358 tt2 : double array 

17359 dtr : double array 

17360 

17361 Returns 

17362 ------- 

17363 tdb1 : double array 

17364 tdb2 : double array 

17365 

17366 Notes 

17367 ----- 

17368 Wraps ERFA function ``eraTttdb``. The ERFA documentation is:: 

17369 

17370 - - - - - - - - - 

17371 e r a T t t d b 

17372 - - - - - - - - - 

17373 

17374 Time scale transformation: Terrestrial Time, TT, to Barycentric 

17375 Dynamical Time, TDB. 

17376 

17377 Given: 

17378 tt1,tt2 double TT as a 2-part Julian Date 

17379 dtr double TDB-TT in seconds 

17380 

17381 Returned: 

17382 tdb1,tdb2 double TDB as a 2-part Julian Date 

17383 

17384 Returned (function value): 

17385 int status: 0 = OK 

17386 

17387 Notes: 

17388 

17389 1) tt1+tt2 is Julian Date, apportioned in any convenient way between 

17390 the two arguments, for example where tt1 is the Julian Day Number 

17391 and tt2 is the fraction of a day. The returned tdb1,tdb2 follow 

17392 suit. 

17393 

17394 2) The argument dtr represents the quasi-periodic component of the 

17395 GR transformation between TT and TCB. It is dependent upon the 

17396 adopted solar-system ephemeris, and can be obtained by numerical 

17397 integration, by interrogating a precomputed time ephemeris or by 

17398 evaluating a model such as that implemented in the ERFA function 

17399 eraDtdb. The quantity is dominated by an annual term of 1.7 ms 

17400 amplitude. 

17401 

17402 3) TDB is essentially the same as Teph, the time argument for the JPL 

17403 solar system ephemerides. 

17404 

17405 References: 

17406 

17407 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

17408 IERS Technical Note No. 32, BKG (2004) 

17409 

17410 IAU 2006 Resolution 3 

17411 

17412 This revision: 2021 May 11 

17413 

17414 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17415 Derived, with permission, from the SOFA library. See notes at end of file. 

17416 

17417 """ 

17418 tdb1, tdb2, c_retval = ufunc.tttdb(tt1, tt2, dtr) 

17419 check_errwarn(c_retval, 'tttdb') 

17420 return tdb1, tdb2 

17421 

17422 

17423STATUS_CODES['tttdb'] = { 

17424 0: 'OK', 

17425} 

17426 

17427 

17428def ttut1(tt1, tt2, dt): 

17429 """ 

17430 Time scale transformation: Terrestrial Time, TT, to Universal Time, 

17431 UT1. 

17432 

17433 Parameters 

17434 ---------- 

17435 tt1 : double array 

17436 tt2 : double array 

17437 dt : double array 

17438 

17439 Returns 

17440 ------- 

17441 ut11 : double array 

17442 ut12 : double array 

17443 

17444 Notes 

17445 ----- 

17446 Wraps ERFA function ``eraTtut1``. The ERFA documentation is:: 

17447 

17448 - - - - - - - - - 

17449 e r a T t u t 1 

17450 - - - - - - - - - 

17451 

17452 Time scale transformation: Terrestrial Time, TT, to Universal Time, 

17453 UT1. 

17454 

17455 Given: 

17456 tt1,tt2 double TT as a 2-part Julian Date 

17457 dt double TT-UT1 in seconds 

17458 

17459 Returned: 

17460 ut11,ut12 double UT1 as a 2-part Julian Date 

17461 

17462 Returned (function value): 

17463 int status: 0 = OK 

17464 

17465 Notes: 

17466 

17467 1) tt1+tt2 is Julian Date, apportioned in any convenient way between 

17468 the two arguments, for example where tt1 is the Julian Day Number 

17469 and tt2 is the fraction of a day. The returned ut11,ut12 follow 

17470 suit. 

17471 

17472 2) The argument dt is classical Delta T. 

17473 

17474 Reference: 

17475 

17476 Explanatory Supplement to the Astronomical Almanac, 

17477 P. Kenneth Seidelmann (ed), University Science Books (1992) 

17478 

17479 This revision: 2021 May 11 

17480 

17481 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17482 Derived, with permission, from the SOFA library. See notes at end of file. 

17483 

17484 """ 

17485 ut11, ut12, c_retval = ufunc.ttut1(tt1, tt2, dt) 

17486 check_errwarn(c_retval, 'ttut1') 

17487 return ut11, ut12 

17488 

17489 

17490STATUS_CODES['ttut1'] = { 

17491 0: 'OK', 

17492} 

17493 

17494 

17495def ut1tai(ut11, ut12, dta): 

17496 """ 

17497 Time scale transformation: Universal Time, UT1, to International 

17498 Atomic Time, TAI. 

17499 

17500 Parameters 

17501 ---------- 

17502 ut11 : double array 

17503 ut12 : double array 

17504 dta : double array 

17505 

17506 Returns 

17507 ------- 

17508 tai1 : double array 

17509 tai2 : double array 

17510 

17511 Notes 

17512 ----- 

17513 Wraps ERFA function ``eraUt1tai``. The ERFA documentation is:: 

17514 

17515 - - - - - - - - - - 

17516 e r a U t 1 t a i 

17517 - - - - - - - - - - 

17518 

17519 Time scale transformation: Universal Time, UT1, to International 

17520 Atomic Time, TAI. 

17521 

17522 Given: 

17523 ut11,ut12 double UT1 as a 2-part Julian Date 

17524 dta double UT1-TAI in seconds 

17525 

17526 Returned: 

17527 tai1,tai2 double TAI as a 2-part Julian Date 

17528 

17529 Returned (function value): 

17530 int status: 0 = OK 

17531 

17532 Notes: 

17533 

17534 1) ut11+ut12 is Julian Date, apportioned in any convenient way 

17535 between the two arguments, for example where ut11 is the Julian 

17536 Day Number and ut12 is the fraction of a day. The returned 

17537 tai1,tai2 follow suit. 

17538 

17539 2) The argument dta, i.e. UT1-TAI, is an observed quantity, and is 

17540 available from IERS tabulations. 

17541 

17542 Reference: 

17543 

17544 Explanatory Supplement to the Astronomical Almanac, 

17545 P. Kenneth Seidelmann (ed), University Science Books (1992) 

17546 

17547 This revision: 2021 May 11 

17548 

17549 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17550 Derived, with permission, from the SOFA library. See notes at end of file. 

17551 

17552 """ 

17553 tai1, tai2, c_retval = ufunc.ut1tai(ut11, ut12, dta) 

17554 check_errwarn(c_retval, 'ut1tai') 

17555 return tai1, tai2 

17556 

17557 

17558STATUS_CODES['ut1tai'] = { 

17559 0: 'OK', 

17560} 

17561 

17562 

17563def ut1tt(ut11, ut12, dt): 

17564 """ 

17565 Time scale transformation: Universal Time, UT1, to Terrestrial 

17566 Time, TT. 

17567 

17568 Parameters 

17569 ---------- 

17570 ut11 : double array 

17571 ut12 : double array 

17572 dt : double array 

17573 

17574 Returns 

17575 ------- 

17576 tt1 : double array 

17577 tt2 : double array 

17578 

17579 Notes 

17580 ----- 

17581 Wraps ERFA function ``eraUt1tt``. The ERFA documentation is:: 

17582 

17583 - - - - - - - - - 

17584 e r a U t 1 t t 

17585 - - - - - - - - - 

17586 

17587 Time scale transformation: Universal Time, UT1, to Terrestrial 

17588 Time, TT. 

17589 

17590 Given: 

17591 ut11,ut12 double UT1 as a 2-part Julian Date 

17592 dt double TT-UT1 in seconds 

17593 

17594 Returned: 

17595 tt1,tt2 double TT as a 2-part Julian Date 

17596 

17597 Returned (function value): 

17598 int status: 0 = OK 

17599 

17600 Notes: 

17601 

17602 1) ut11+ut12 is Julian Date, apportioned in any convenient way 

17603 between the two arguments, for example where ut11 is the Julian 

17604 Day Number and ut12 is the fraction of a day. The returned 

17605 tt1,tt2 follow suit. 

17606 

17607 2) The argument dt is classical Delta T. 

17608 

17609 Reference: 

17610 

17611 Explanatory Supplement to the Astronomical Almanac, 

17612 P. Kenneth Seidelmann (ed), University Science Books (1992) 

17613 

17614 This revision: 2021 May 11 

17615 

17616 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17617 Derived, with permission, from the SOFA library. See notes at end of file. 

17618 

17619 """ 

17620 tt1, tt2, c_retval = ufunc.ut1tt(ut11, ut12, dt) 

17621 check_errwarn(c_retval, 'ut1tt') 

17622 return tt1, tt2 

17623 

17624 

17625STATUS_CODES['ut1tt'] = { 

17626 0: 'OK', 

17627} 

17628 

17629 

17630def ut1utc(ut11, ut12, dut1): 

17631 """ 

17632 Time scale transformation: Universal Time, UT1, to Coordinated 

17633 Universal Time, UTC. 

17634 

17635 Parameters 

17636 ---------- 

17637 ut11 : double array 

17638 ut12 : double array 

17639 dut1 : double array 

17640 

17641 Returns 

17642 ------- 

17643 utc1 : double array 

17644 utc2 : double array 

17645 

17646 Notes 

17647 ----- 

17648 Wraps ERFA function ``eraUt1utc``. The ERFA documentation is:: 

17649 

17650 - - - - - - - - - - 

17651 e r a U t 1 u t c 

17652 - - - - - - - - - - 

17653 

17654 Time scale transformation: Universal Time, UT1, to Coordinated 

17655 Universal Time, UTC. 

17656 

17657 Given: 

17658 ut11,ut12 double UT1 as a 2-part Julian Date (Note 1) 

17659 dut1 double Delta UT1: UT1-UTC in seconds (Note 2) 

17660 

17661 Returned: 

17662 utc1,utc2 double UTC as a 2-part quasi Julian Date (Notes 3,4) 

17663 

17664 Returned (function value): 

17665 int status: +1 = dubious year (Note 5) 

17666 0 = OK 

17667 -1 = unacceptable date 

17668 

17669 Notes: 

17670 

17671 1) ut11+ut12 is Julian Date, apportioned in any convenient way 

17672 between the two arguments, for example where ut11 is the Julian 

17673 Day Number and ut12 is the fraction of a day. The returned utc1 

17674 and utc2 form an analogous pair, except that a special convention 

17675 is used, to deal with the problem of leap seconds - see Note 3. 

17676 

17677 2) Delta UT1 can be obtained from tabulations provided by the 

17678 International Earth Rotation and Reference Systems Service. The 

17679 value changes abruptly by 1s at a leap second; however, close to 

17680 a leap second the algorithm used here is tolerant of the "wrong" 

17681 choice of value being made. 

17682 

17683 3) JD cannot unambiguously represent UTC during a leap second unless 

17684 special measures are taken. The convention in the present 

17685 function is that the returned quasi-JD UTC1+UTC2 represents UTC 

17686 days whether the length is 86399, 86400 or 86401 SI seconds. 

17687 

17688 4) The function eraD2dtf can be used to transform the UTC quasi-JD 

17689 into calendar date and clock time, including UTC leap second 

17690 handling. 

17691 

17692 5) The warning status "dubious year" flags UTCs that predate the 

17693 introduction of the time scale or that are too far in the future 

17694 to be trusted. See eraDat for further details. 

17695 

17696 Called: 

17697 eraJd2cal JD to Gregorian calendar 

17698 eraDat delta(AT) = TAI-UTC 

17699 eraCal2jd Gregorian calendar to JD 

17700 

17701 References: 

17702 

17703 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

17704 IERS Technical Note No. 32, BKG (2004) 

17705 

17706 Explanatory Supplement to the Astronomical Almanac, 

17707 P. Kenneth Seidelmann (ed), University Science Books (1992) 

17708 

17709 This revision: 2021 May 11 

17710 

17711 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17712 Derived, with permission, from the SOFA library. See notes at end of file. 

17713 

17714 """ 

17715 utc1, utc2, c_retval = ufunc.ut1utc(ut11, ut12, dut1) 

17716 check_errwarn(c_retval, 'ut1utc') 

17717 return utc1, utc2 

17718 

17719 

17720STATUS_CODES['ut1utc'] = { 

17721 1: 'dubious year (Note 5)', 

17722 0: 'OK', 

17723 -1: 'unacceptable date', 

17724} 

17725 

17726 

17727def utctai(utc1, utc2): 

17728 """ 

17729 Time scale transformation: Coordinated Universal Time, UTC, to 

17730 International Atomic Time, TAI. 

17731 

17732 Parameters 

17733 ---------- 

17734 utc1 : double array 

17735 utc2 : double array 

17736 

17737 Returns 

17738 ------- 

17739 tai1 : double array 

17740 tai2 : double array 

17741 

17742 Notes 

17743 ----- 

17744 Wraps ERFA function ``eraUtctai``. The ERFA documentation is:: 

17745 

17746 - - - - - - - - - - 

17747 e r a U t c t a i 

17748 - - - - - - - - - - 

17749 

17750 Time scale transformation: Coordinated Universal Time, UTC, to 

17751 International Atomic Time, TAI. 

17752 

17753 Given: 

17754 utc1,utc2 double UTC as a 2-part quasi Julian Date (Notes 1-4) 

17755 

17756 Returned: 

17757 tai1,tai2 double TAI as a 2-part Julian Date (Note 5) 

17758 

17759 Returned (function value): 

17760 int status: +1 = dubious year (Note 3) 

17761 0 = OK 

17762 -1 = unacceptable date 

17763 

17764 Notes: 

17765 

17766 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any 

17767 convenient way between the two arguments, for example where utc1 

17768 is the Julian Day Number and utc2 is the fraction of a day. 

17769 

17770 2) JD cannot unambiguously represent UTC during a leap second unless 

17771 special measures are taken. The convention in the present 

17772 function is that the JD day represents UTC days whether the 

17773 length is 86399, 86400 or 86401 SI seconds. In the 1960-1972 era 

17774 there were smaller jumps (in either direction) each time the 

17775 linear UTC(TAI) expression was changed, and these "mini-leaps" 

17776 are also included in the ERFA convention. 

17777 

17778 3) The warning status "dubious year" flags UTCs that predate the 

17779 introduction of the time scale or that are too far in the future 

17780 to be trusted. See eraDat for further details. 

17781 

17782 4) The function eraDtf2d converts from calendar date and time of day 

17783 into 2-part Julian Date, and in the case of UTC implements the 

17784 leap-second-ambiguity convention described above. 

17785 

17786 5) The returned TAI1,TAI2 are such that their sum is the TAI Julian 

17787 Date. 

17788 

17789 Called: 

17790 eraJd2cal JD to Gregorian calendar 

17791 eraDat delta(AT) = TAI-UTC 

17792 eraCal2jd Gregorian calendar to JD 

17793 

17794 References: 

17795 

17796 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

17797 IERS Technical Note No. 32, BKG (2004) 

17798 

17799 Explanatory Supplement to the Astronomical Almanac, 

17800 P. Kenneth Seidelmann (ed), University Science Books (1992) 

17801 

17802 This revision: 2021 May 11 

17803 

17804 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17805 Derived, with permission, from the SOFA library. See notes at end of file. 

17806 

17807 """ 

17808 tai1, tai2, c_retval = ufunc.utctai(utc1, utc2) 

17809 check_errwarn(c_retval, 'utctai') 

17810 return tai1, tai2 

17811 

17812 

17813STATUS_CODES['utctai'] = { 

17814 1: 'dubious year (Note 3)', 

17815 0: 'OK', 

17816 -1: 'unacceptable date', 

17817} 

17818 

17819 

17820def utcut1(utc1, utc2, dut1): 

17821 """ 

17822 Time scale transformation: Coordinated Universal Time, UTC, to 

17823 Universal Time, UT1. 

17824 

17825 Parameters 

17826 ---------- 

17827 utc1 : double array 

17828 utc2 : double array 

17829 dut1 : double array 

17830 

17831 Returns 

17832 ------- 

17833 ut11 : double array 

17834 ut12 : double array 

17835 

17836 Notes 

17837 ----- 

17838 Wraps ERFA function ``eraUtcut1``. The ERFA documentation is:: 

17839 

17840 - - - - - - - - - - 

17841 e r a U t c u t 1 

17842 - - - - - - - - - - 

17843 

17844 Time scale transformation: Coordinated Universal Time, UTC, to 

17845 Universal Time, UT1. 

17846 

17847 Given: 

17848 utc1,utc2 double UTC as a 2-part quasi Julian Date (Notes 1-4) 

17849 dut1 double Delta UT1 = UT1-UTC in seconds (Note 5) 

17850 

17851 Returned: 

17852 ut11,ut12 double UT1 as a 2-part Julian Date (Note 6) 

17853 

17854 Returned (function value): 

17855 int status: +1 = dubious year (Note 3) 

17856 0 = OK 

17857 -1 = unacceptable date 

17858 

17859 Notes: 

17860 

17861 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any 

17862 convenient way between the two arguments, for example where utc1 

17863 is the Julian Day Number and utc2 is the fraction of a day. 

17864 

17865 2) JD cannot unambiguously represent UTC during a leap second unless 

17866 special measures are taken. The convention in the present 

17867 function is that the JD day represents UTC days whether the 

17868 length is 86399, 86400 or 86401 SI seconds. 

17869 

17870 3) The warning status "dubious year" flags UTCs that predate the 

17871 introduction of the time scale or that are too far in the future 

17872 to be trusted. See eraDat for further details. 

17873 

17874 4) The function eraDtf2d converts from calendar date and time of 

17875 day into 2-part Julian Date, and in the case of UTC implements 

17876 the leap-second-ambiguity convention described above. 

17877 

17878 5) Delta UT1 can be obtained from tabulations provided by the 

17879 International Earth Rotation and Reference Systems Service. 

17880 It is the caller's responsibility to supply a dut1 argument 

17881 containing the UT1-UTC value that matches the given UTC. 

17882 

17883 6) The returned ut11,ut12 are such that their sum is the UT1 Julian 

17884 Date. 

17885 

17886 References: 

17887 

17888 McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), 

17889 IERS Technical Note No. 32, BKG (2004) 

17890 

17891 Explanatory Supplement to the Astronomical Almanac, 

17892 P. Kenneth Seidelmann (ed), University Science Books (1992) 

17893 

17894 Called: 

17895 eraJd2cal JD to Gregorian calendar 

17896 eraDat delta(AT) = TAI-UTC 

17897 eraUtctai UTC to TAI 

17898 eraTaiut1 TAI to UT1 

17899 

17900 This revision: 2021 May 11 

17901 

17902 Copyright (C) 2013-2021, NumFOCUS Foundation. 

17903 Derived, with permission, from the SOFA library. See notes at end of file. 

17904 

17905 """ 

17906 ut11, ut12, c_retval = ufunc.utcut1(utc1, utc2, dut1) 

17907 check_errwarn(c_retval, 'utcut1') 

17908 return ut11, ut12 

17909 

17910 

17911STATUS_CODES['utcut1'] = { 

17912 1: 'dubious year (Note 3)', 

17913 0: 'OK', 

17914 -1: 'unacceptable date', 

17915} 

17916 

17917 

17918def ae2hd(az, el, phi): 

17919 """ 

17920 Horizon to equatorial coordinates: transform azimuth and altitude 

17921 to hour angle and declination. 

17922 

17923 Parameters 

17924 ---------- 

17925 az : double array 

17926 el : double array 

17927 phi : double array 

17928 

17929 Returns 

17930 ------- 

17931 ha : double array 

17932 dec : double array 

17933 

17934 Notes 

17935 ----- 

17936 Wraps ERFA function ``eraAe2hd``. The ERFA documentation is:: 

17937 

17938 - - - - - - - - - 

17939 e r a A e 2 h d 

17940 - - - - - - - - - 

17941 

17942 Horizon to equatorial coordinates: transform azimuth and altitude 

17943 to hour angle and declination. 

17944 

17945 Given: 

17946 az double azimuth 

17947 el double altitude (informally, elevation) 

17948 phi double site latitude 

17949 

17950 Returned: 

17951 ha double hour angle (local) 

17952 dec double declination 

17953 

17954 Notes: 

17955 

17956 1) All the arguments are angles in radians. 

17957 

17958 2) The sign convention for azimuth is north zero, east +pi/2. 

17959 

17960 3) HA is returned in the range +/-pi. Declination is returned in 

17961 the range +/-pi/2. 

17962 

17963 4) The latitude phi is pi/2 minus the angle between the Earth's 

17964 rotation axis and the adopted zenith. In many applications it 

17965 will be sufficient to use the published geodetic latitude of the 

17966 site. In very precise (sub-arcsecond) applications, phi can be 

17967 corrected for polar motion. 

17968 

17969 5) The azimuth az must be with respect to the rotational north pole, 

17970 as opposed to the ITRS pole, and an azimuth with respect to north 

17971 on a map of the Earth's surface will need to be adjusted for 

17972 polar motion if sub-arcsecond accuracy is required. 

17973 

17974 6) Should the user wish to work with respect to the astronomical 

17975 zenith rather than the geodetic zenith, phi will need to be 

17976 adjusted for deflection of the vertical (often tens of 

17977 arcseconds), and the zero point of ha will also be affected. 

17978 

17979 7) The transformation is the same as Ve = Ry(phi-pi/2)*Rz(pi)*Vh, 

17980 where Ve and Vh are lefthanded unit vectors in the (ha,dec) and 

17981 (az,el) systems respectively and Rz and Ry are rotations about 

17982 first the z-axis and then the y-axis. (n.b. Rz(pi) simply 

17983 reverses the signs of the x and y components.) For efficiency, 

17984 the algorithm is written out rather than calling other utility 

17985 functions. For applications that require even greater 

17986 efficiency, additional savings are possible if constant terms 

17987 such as functions of latitude are computed once and for all. 

17988 

17989 8) Again for efficiency, no range checking of arguments is carried 

17990 out. 

17991 

17992 Last revision: 2017 September 12 

17993 

17994 ERFA release 2021-05-12 

17995 

17996 Copyright (C) 2021 IAU ERFA Board. See notes at end. 

17997 

17998 """ 

17999 ha, dec = ufunc.ae2hd(az, el, phi) 

18000 return ha, dec 

18001 

18002 

18003def hd2ae(ha, dec, phi): 

18004 """ 

18005 Equatorial to horizon coordinates: transform hour angle and 

18006 declination to azimuth and altitude. 

18007 

18008 Parameters 

18009 ---------- 

18010 ha : double array 

18011 dec : double array 

18012 phi : double array 

18013 

18014 Returns 

18015 ------- 

18016 az : double array 

18017 el : double array 

18018 

18019 Notes 

18020 ----- 

18021 Wraps ERFA function ``eraHd2ae``. The ERFA documentation is:: 

18022 

18023 - - - - - - - - - 

18024 e r a H d 2 a e 

18025 - - - - - - - - - 

18026 

18027 Equatorial to horizon coordinates: transform hour angle and 

18028 declination to azimuth and altitude. 

18029 

18030 Given: 

18031 ha double hour angle (local) 

18032 dec double declination 

18033 phi double site latitude 

18034 

18035 Returned: 

18036 *az double azimuth 

18037 *el double altitude (informally, elevation) 

18038 

18039 Notes: 

18040 

18041 1) All the arguments are angles in radians. 

18042 

18043 2) Azimuth is returned in the range 0-2pi; north is zero, and east 

18044 is +pi/2. Altitude is returned in the range +/- pi/2. 

18045 

18046 3) The latitude phi is pi/2 minus the angle between the Earth's 

18047 rotation axis and the adopted zenith. In many applications it 

18048 will be sufficient to use the published geodetic latitude of the 

18049 site. In very precise (sub-arcsecond) applications, phi can be 

18050 corrected for polar motion. 

18051 

18052 4) The returned azimuth az is with respect to the rotational north 

18053 pole, as opposed to the ITRS pole, and for sub-arcsecond 

18054 accuracy will need to be adjusted for polar motion if it is to 

18055 be with respect to north on a map of the Earth's surface. 

18056 

18057 5) Should the user wish to work with respect to the astronomical 

18058 zenith rather than the geodetic zenith, phi will need to be 

18059 adjusted for deflection of the vertical (often tens of 

18060 arcseconds), and the zero point of the hour angle ha will also 

18061 be affected. 

18062 

18063 6) The transformation is the same as Vh = Rz(pi)*Ry(pi/2-phi)*Ve, 

18064 where Vh and Ve are lefthanded unit vectors in the (az,el) and 

18065 (ha,dec) systems respectively and Ry and Rz are rotations about 

18066 first the y-axis and then the z-axis. (n.b. Rz(pi) simply 

18067 reverses the signs of the x and y components.) For efficiency, 

18068 the algorithm is written out rather than calling other utility 

18069 functions. For applications that require even greater 

18070 efficiency, additional savings are possible if constant terms 

18071 such as functions of latitude are computed once and for all. 

18072 

18073 7) Again for efficiency, no range checking of arguments is carried 

18074 out. 

18075 

18076 Last revision: 2021 February 24 

18077 

18078 ERFA release 2021-05-12 

18079 

18080 Copyright (C) 2021 IAU ERFA Board. See notes at end. 

18081 

18082 """ 

18083 az, el = ufunc.hd2ae(ha, dec, phi) 

18084 return az, el 

18085 

18086 

18087def hd2pa(ha, dec, phi): 

18088 """ 

18089 Parallactic angle for a given hour angle and declination. 

18090 

18091 Parameters 

18092 ---------- 

18093 ha : double array 

18094 dec : double array 

18095 phi : double array 

18096 

18097 Returns 

18098 ------- 

18099 c_retval : double array 

18100 

18101 Notes 

18102 ----- 

18103 Wraps ERFA function ``eraHd2pa``. The ERFA documentation is:: 

18104 

18105 - - - - - - - - - 

18106 e r a H d 2 p a 

18107 - - - - - - - - - 

18108 

18109 Parallactic angle for a given hour angle and declination. 

18110 

18111 Given: 

18112 ha double hour angle 

18113 dec double declination 

18114 phi double site latitude 

18115 

18116 Returned (function value): 

18117 double parallactic angle 

18118 

18119 Notes: 

18120 

18121 1) All the arguments are angles in radians. 

18122 

18123 2) The parallactic angle at a point in the sky is the position 

18124 angle of the vertical, i.e. the angle between the directions to 

18125 the north celestial pole and to the zenith respectively. 

18126 

18127 3) The result is returned in the range -pi to +pi. 

18128 

18129 4) At the pole itself a zero result is returned. 

18130 

18131 5) The latitude phi is pi/2 minus the angle between the Earth's 

18132 rotation axis and the adopted zenith. In many applications it 

18133 will be sufficient to use the published geodetic latitude of the 

18134 site. In very precise (sub-arcsecond) applications, phi can be 

18135 corrected for polar motion. 

18136 

18137 6) Should the user wish to work with respect to the astronomical 

18138 zenith rather than the geodetic zenith, phi will need to be 

18139 adjusted for deflection of the vertical (often tens of 

18140 arcseconds), and the zero point of the hour angle ha will also 

18141 be affected. 

18142 

18143 Reference: 

18144 Smart, W.M., "Spherical Astronomy", Cambridge University Press, 

18145 6th edition (Green, 1977), p49. 

18146 

18147 Last revision: 2017 September 12 

18148 

18149 ERFA release 2021-05-12 

18150 

18151 Copyright (C) 2021 IAU ERFA Board. See notes at end. 

18152 

18153 """ 

18154 c_retval = ufunc.hd2pa(ha, dec, phi) 

18155 return c_retval 

18156 

18157 

18158def tpors(xi, eta, a, b): 

18159 """ 

18160 In the tangent plane projection, given the rectangular coordinates 

18161 of a star and its spherical coordinates, determine the spherical 

18162 coordinates of the tangent point. 

18163 

18164 Parameters 

18165 ---------- 

18166 xi : double array 

18167 eta : double array 

18168 a : double array 

18169 b : double array 

18170 

18171 Returns 

18172 ------- 

18173 a01 : double array 

18174 b01 : double array 

18175 a02 : double array 

18176 b02 : double array 

18177 

18178 Notes 

18179 ----- 

18180 Wraps ERFA function ``eraTpors``. The ERFA documentation is:: 

18181 

18182 - - - - - - - - - 

18183 e r a T p o r s 

18184 - - - - - - - - - 

18185 

18186 In the tangent plane projection, given the rectangular coordinates 

18187 of a star and its spherical coordinates, determine the spherical 

18188 coordinates of the tangent point. 

18189 

18190 Given: 

18191 xi,eta double rectangular coordinates of star image (Note 2) 

18192 a,b double star's spherical coordinates (Note 3) 

18193 

18194 Returned: 

18195 *a01,*b01 double tangent point's spherical coordinates, Soln. 1 

18196 *a02,*b02 double tangent point's spherical coordinates, Soln. 2 

18197 

18198 Returned (function value): 

18199 int number of solutions: 

18200 0 = no solutions returned (Note 5) 

18201 1 = only the first solution is useful (Note 6) 

18202 2 = both solutions are useful (Note 6) 

18203 

18204 Notes: 

18205 

18206 1) The tangent plane projection is also called the "gnomonic 

18207 projection" and the "central projection". 

18208 

18209 2) The eta axis points due north in the adopted coordinate system. 

18210 If the spherical coordinates are observed (RA,Dec), the tangent 

18211 plane coordinates (xi,eta) are conventionally called the 

18212 "standard coordinates". If the spherical coordinates are with 

18213 respect to a right-handed triad, (xi,eta) are also right-handed. 

18214 The units of (xi,eta) are, effectively, radians at the tangent 

18215 point. 

18216 

18217 3) All angular arguments are in radians. 

18218 

18219 4) The angles a01 and a02 are returned in the range 0-2pi. The 

18220 angles b01 and b02 are returned in the range +/-pi, but in the 

18221 usual, non-pole-crossing, case, the range is +/-pi/2. 

18222 

18223 5) Cases where there is no solution can arise only near the poles. 

18224 For example, it is clearly impossible for a star at the pole 

18225 itself to have a non-zero xi value, and hence it is meaningless 

18226 to ask where the tangent point would have to be to bring about 

18227 this combination of xi and dec. 

18228 

18229 6) Also near the poles, cases can arise where there are two useful 

18230 solutions. The return value indicates whether the second of the 

18231 two solutions returned is useful; 1 indicates only one useful 

18232 solution, the usual case. 

18233 

18234 7) The basis of the algorithm is to solve the spherical triangle PSC, 

18235 where P is the north celestial pole, S is the star and C is the 

18236 tangent point. The spherical coordinates of the tangent point are 

18237 [a0,b0]; writing rho^2 = (xi^2+eta^2) and r^2 = (1+rho^2), side c 

18238 is then (pi/2-b), side p is sqrt(xi^2+eta^2) and side s (to be 

18239 found) is (pi/2-b0). Angle C is given by sin(C) = xi/rho and 

18240 cos(C) = eta/rho. Angle P (to be found) is the longitude 

18241 difference between star and tangent point (a-a0). 

18242 

18243 8) This function is a member of the following set: 

18244 

18245 spherical vector solve for 

18246 

18247 eraTpxes eraTpxev xi,eta 

18248 eraTpsts eraTpstv star 

18249 > eraTpors < eraTporv origin 

18250 

18251 Called: 

18252 eraAnp normalize angle into range 0 to 2pi 

18253 

18254 References: 

18255 

18256 Calabretta M.R. & Greisen, E.W., 2002, "Representations of 

18257 celestial coordinates in FITS", Astron.Astrophys. 395, 1077 

18258 

18259 Green, R.M., "Spherical Astronomy", Cambridge University Press, 

18260 1987, Chapter 13. 

18261 

18262 This revision: 2018 January 2 

18263 

18264 Copyright (C) 2013-2021, NumFOCUS Foundation. 

18265 Derived, with permission, from the SOFA library. See notes at end of file. 

18266 

18267 """ 

18268 a01, b01, a02, b02, c_retval = ufunc.tpors(xi, eta, a, b) 

18269 check_errwarn(c_retval, 'tpors') 

18270 return a01, b01, a02, b02 

18271 

18272 

18273def tporv(xi, eta, v): 

18274 """ 

18275 In the tangent plane projection, given the rectangular coordinates 

18276 of a star and its direction cosines, determine the direction 

18277 cosines of the tangent point. 

18278 

18279 Parameters 

18280 ---------- 

18281 xi : double array 

18282 eta : double array 

18283 v : double array 

18284 

18285 Returns 

18286 ------- 

18287 v01 : double array 

18288 v02 : double array 

18289 

18290 Notes 

18291 ----- 

18292 Wraps ERFA function ``eraTporv``. The ERFA documentation is:: 

18293 

18294 - - - - - - - - - 

18295 e r a T p o r v 

18296 - - - - - - - - - 

18297 

18298 In the tangent plane projection, given the rectangular coordinates 

18299 of a star and its direction cosines, determine the direction 

18300 cosines of the tangent point. 

18301 

18302 Given: 

18303 xi,eta double rectangular coordinates of star image (Note 2) 

18304 v double[3] star's direction cosines (Note 3) 

18305 

18306 Returned: 

18307 v01 double[3] tangent point's direction cosines, Solution 1 

18308 v02 double[3] tangent point's direction cosines, Solution 2 

18309 

18310 Returned (function value): 

18311 int number of solutions: 

18312 0 = no solutions returned (Note 4) 

18313 1 = only the first solution is useful (Note 5) 

18314 2 = both solutions are useful (Note 5) 

18315 

18316 Notes: 

18317 

18318 1) The tangent plane projection is also called the "gnomonic 

18319 projection" and the "central projection". 

18320 

18321 2) The eta axis points due north in the adopted coordinate system. 

18322 If the direction cosines represent observed (RA,Dec), the tangent 

18323 plane coordinates (xi,eta) are conventionally called the 

18324 "standard coordinates". If the direction cosines are with 

18325 respect to a right-handed triad, (xi,eta) are also right-handed. 

18326 The units of (xi,eta) are, effectively, radians at the tangent 

18327 point. 

18328 

18329 3) The vector v must be of unit length or the result will be wrong. 

18330 

18331 4) Cases where there is no solution can arise only near the poles. 

18332 For example, it is clearly impossible for a star at the pole 

18333 itself to have a non-zero xi value, and hence it is meaningless 

18334 to ask where the tangent point would have to be. 

18335 

18336 5) Also near the poles, cases can arise where there are two useful 

18337 solutions. The return value indicates whether the second of the 

18338 two solutions returned is useful; 1 indicates only one useful 

18339 solution, the usual case. 

18340 

18341 6) The basis of the algorithm is to solve the spherical triangle 

18342 PSC, where P is the north celestial pole, S is the star and C is 

18343 the tangent point. Calling the celestial spherical coordinates 

18344 of the star and tangent point (a,b) and (a0,b0) respectively, and 

18345 writing rho^2 = (xi^2+eta^2) and r^2 = (1+rho^2), and 

18346 transforming the vector v into (a,b) in the normal way, side c is 

18347 then (pi/2-b), side p is sqrt(xi^2+eta^2) and side s (to be 

18348 found) is (pi/2-b0), while angle C is given by sin(C) = xi/rho 

18349 and cos(C) = eta/rho; angle P (to be found) is (a-a0). After 

18350 solving the spherical triangle, the result (a0,b0) can be 

18351 expressed in vector form as v0. 

18352 

18353 7) This function is a member of the following set: 

18354 

18355 spherical vector solve for 

18356 

18357 eraTpxes eraTpxev xi,eta 

18358 eraTpsts eraTpstv star 

18359 eraTpors > eraTporv < origin 

18360 

18361 References: 

18362 

18363 Calabretta M.R. & Greisen, E.W., 2002, "Representations of 

18364 celestial coordinates in FITS", Astron.Astrophys. 395, 1077 

18365 

18366 Green, R.M., "Spherical Astronomy", Cambridge University Press, 

18367 1987, Chapter 13. 

18368 

18369 This revision: 2018 January 2 

18370 

18371 Copyright (C) 2013-2021, NumFOCUS Foundation. 

18372 Derived, with permission, from the SOFA library. See notes at end of file. 

18373 

18374 """ 

18375 v01, v02, c_retval = ufunc.tporv(xi, eta, v) 

18376 check_errwarn(c_retval, 'tporv') 

18377 return v01, v02 

18378 

18379 

18380def tpsts(xi, eta, a0, b0): 

18381 """ 

18382 In the tangent plane projection, given the star's rectangular 

18383 coordinates and the spherical coordinates of the tangent point, 

18384 solve for the spherical coordinates of the star. 

18385 

18386 Parameters 

18387 ---------- 

18388 xi : double array 

18389 eta : double array 

18390 a0 : double array 

18391 b0 : double array 

18392 

18393 Returns 

18394 ------- 

18395 a : double array 

18396 b : double array 

18397 

18398 Notes 

18399 ----- 

18400 Wraps ERFA function ``eraTpsts``. The ERFA documentation is:: 

18401 

18402 - - - - - - - - - 

18403 e r a T p s t s 

18404 - - - - - - - - - 

18405 

18406 In the tangent plane projection, given the star's rectangular 

18407 coordinates and the spherical coordinates of the tangent point, 

18408 solve for the spherical coordinates of the star. 

18409 

18410 Given: 

18411 xi,eta double rectangular coordinates of star image (Note 2) 

18412 a0,b0 double tangent point's spherical coordinates 

18413 

18414 Returned: 

18415 *a,*b double star's spherical coordinates 

18416 

18417 1) The tangent plane projection is also called the "gnomonic 

18418 projection" and the "central projection". 

18419 

18420 2) The eta axis points due north in the adopted coordinate system. 

18421 If the spherical coordinates are observed (RA,Dec), the tangent 

18422 plane coordinates (xi,eta) are conventionally called the 

18423 "standard coordinates". If the spherical coordinates are with 

18424 respect to a right-handed triad, (xi,eta) are also right-handed. 

18425 The units of (xi,eta) are, effectively, radians at the tangent 

18426 point. 

18427 

18428 3) All angular arguments are in radians. 

18429 

18430 4) This function is a member of the following set: 

18431 

18432 spherical vector solve for 

18433 

18434 eraTpxes eraTpxev xi,eta 

18435 > eraTpsts < eraTpstv star 

18436 eraTpors eraTporv origin 

18437 

18438 Called: 

18439 eraAnp normalize angle into range 0 to 2pi 

18440 

18441 References: 

18442 

18443 Calabretta M.R. & Greisen, E.W., 2002, "Representations of 

18444 celestial coordinates in FITS", Astron.Astrophys. 395, 1077 

18445 

18446 Green, R.M., "Spherical Astronomy", Cambridge University Press, 

18447 1987, Chapter 13. 

18448 

18449 This revision: 2018 January 2 

18450 

18451 Copyright (C) 2013-2021, NumFOCUS Foundation. 

18452 Derived, with permission, from the SOFA library. See notes at end of file. 

18453 

18454 """ 

18455 a, b = ufunc.tpsts(xi, eta, a0, b0) 

18456 return a, b 

18457 

18458 

18459def tpstv(xi, eta, v0): 

18460 """ 

18461 In the tangent plane projection, given the star's rectangular 

18462 coordinates and the direction cosines of the tangent point, solve 

18463 for the direction cosines of the star. 

18464 

18465 Parameters 

18466 ---------- 

18467 xi : double array 

18468 eta : double array 

18469 v0 : double array 

18470 

18471 Returns 

18472 ------- 

18473 v : double array 

18474 

18475 Notes 

18476 ----- 

18477 Wraps ERFA function ``eraTpstv``. The ERFA documentation is:: 

18478 

18479 - - - - - - - - - 

18480 e r a T p s t v 

18481 - - - - - - - - - 

18482 

18483 In the tangent plane projection, given the star's rectangular 

18484 coordinates and the direction cosines of the tangent point, solve 

18485 for the direction cosines of the star. 

18486 

18487 Given: 

18488 xi,eta double rectangular coordinates of star image (Note 2) 

18489 v0 double[3] tangent point's direction cosines 

18490 

18491 Returned: 

18492 v double[3] star's direction cosines 

18493 

18494 1) The tangent plane projection is also called the "gnomonic 

18495 projection" and the "central projection". 

18496 

18497 2) The eta axis points due north in the adopted coordinate system. 

18498 If the direction cosines represent observed (RA,Dec), the tangent 

18499 plane coordinates (xi,eta) are conventionally called the 

18500 "standard coordinates". If the direction cosines are with 

18501 respect to a right-handed triad, (xi,eta) are also right-handed. 

18502 The units of (xi,eta) are, effectively, radians at the tangent 

18503 point. 

18504 

18505 3) The method used is to complete the star vector in the (xi,eta) 

18506 based triad and normalize it, then rotate the triad to put the 

18507 tangent point at the pole with the x-axis aligned to zero 

18508 longitude. Writing (a0,b0) for the celestial spherical 

18509 coordinates of the tangent point, the sequence of rotations is 

18510 (b-pi/2) around the x-axis followed by (-a-pi/2) around the 

18511 z-axis. 

18512 

18513 4) If vector v0 is not of unit length, the returned vector v will 

18514 be wrong. 

18515 

18516 5) If vector v0 points at a pole, the returned vector v will be 

18517 based on the arbitrary assumption that the longitude coordinate 

18518 of the tangent point is zero. 

18519 

18520 6) This function is a member of the following set: 

18521 

18522 spherical vector solve for 

18523 

18524 eraTpxes eraTpxev xi,eta 

18525 eraTpsts > eraTpstv < star 

18526 eraTpors eraTporv origin 

18527 

18528 References: 

18529 

18530 Calabretta M.R. & Greisen, E.W., 2002, "Representations of 

18531 celestial coordinates in FITS", Astron.Astrophys. 395, 1077 

18532 

18533 Green, R.M., "Spherical Astronomy", Cambridge University Press, 

18534 1987, Chapter 13. 

18535 

18536 This revision: 2018 January 2 

18537 

18538 Copyright (C) 2013-2021, NumFOCUS Foundation. 

18539 Derived, with permission, from the SOFA library. See notes at end of file. 

18540 

18541 """ 

18542 v = ufunc.tpstv(xi, eta, v0) 

18543 return v 

18544 

18545 

18546def tpxes(a, b, a0, b0): 

18547 """ 

18548 In the tangent plane projection, given celestial spherical 

18549 coordinates for a star and the tangent point, solve for the star's 

18550 rectangular coordinates in the tangent plane. 

18551 

18552 Parameters 

18553 ---------- 

18554 a : double array 

18555 b : double array 

18556 a0 : double array 

18557 b0 : double array 

18558 

18559 Returns 

18560 ------- 

18561 xi : double array 

18562 eta : double array 

18563 

18564 Notes 

18565 ----- 

18566 Wraps ERFA function ``eraTpxes``. The ERFA documentation is:: 

18567 

18568 - - - - - - - - - 

18569 e r a T p x e s 

18570 - - - - - - - - - 

18571 

18572 In the tangent plane projection, given celestial spherical 

18573 coordinates for a star and the tangent point, solve for the star's 

18574 rectangular coordinates in the tangent plane. 

18575 

18576 Given: 

18577 a,b double star's spherical coordinates 

18578 a0,b0 double tangent point's spherical coordinates 

18579 

18580 Returned: 

18581 *xi,*eta double rectangular coordinates of star image (Note 2) 

18582 

18583 Returned (function value): 

18584 int status: 0 = OK 

18585 1 = star too far from axis 

18586 2 = antistar on tangent plane 

18587 3 = antistar too far from axis 

18588 

18589 Notes: 

18590 

18591 1) The tangent plane projection is also called the "gnomonic 

18592 projection" and the "central projection". 

18593 

18594 2) The eta axis points due north in the adopted coordinate system. 

18595 If the spherical coordinates are observed (RA,Dec), the tangent 

18596 plane coordinates (xi,eta) are conventionally called the 

18597 "standard coordinates". For right-handed spherical coordinates, 

18598 (xi,eta) are also right-handed. The units of (xi,eta) are, 

18599 effectively, radians at the tangent point. 

18600 

18601 3) All angular arguments are in radians. 

18602 

18603 4) This function is a member of the following set: 

18604 

18605 spherical vector solve for 

18606 

18607 > eraTpxes < eraTpxev xi,eta 

18608 eraTpsts eraTpstv star 

18609 eraTpors eraTporv origin 

18610 

18611 References: 

18612 

18613 Calabretta M.R. & Greisen, E.W., 2002, "Representations of 

18614 celestial coordinates in FITS", Astron.Astrophys. 395, 1077 

18615 

18616 Green, R.M., "Spherical Astronomy", Cambridge University Press, 

18617 1987, Chapter 13. 

18618 

18619 This revision: 2018 January 2 

18620 

18621 Copyright (C) 2013-2021, NumFOCUS Foundation. 

18622 Derived, with permission, from the SOFA library. See notes at end of file. 

18623 

18624 """ 

18625 xi, eta, c_retval = ufunc.tpxes(a, b, a0, b0) 

18626 check_errwarn(c_retval, 'tpxes') 

18627 return xi, eta 

18628 

18629 

18630STATUS_CODES['tpxes'] = { 

18631 0: 'OK', 

18632 1: 'star too far from axis', 

18633 2: 'antistar on tangent plane', 

18634 3: 'antistar too far from axis', 

18635} 

18636 

18637 

18638def tpxev(v, v0): 

18639 """ 

18640 In the tangent plane projection, given celestial direction cosines 

18641 for a star and the tangent point, solve for the star's rectangular 

18642 coordinates in the tangent plane. 

18643 

18644 Parameters 

18645 ---------- 

18646 v : double array 

18647 v0 : double array 

18648 

18649 Returns 

18650 ------- 

18651 xi : double array 

18652 eta : double array 

18653 

18654 Notes 

18655 ----- 

18656 Wraps ERFA function ``eraTpxev``. The ERFA documentation is:: 

18657 

18658 - - - - - - - - - 

18659 e r a T p x e v 

18660 - - - - - - - - - 

18661 

18662 In the tangent plane projection, given celestial direction cosines 

18663 for a star and the tangent point, solve for the star's rectangular 

18664 coordinates in the tangent plane. 

18665 

18666 Given: 

18667 v double[3] direction cosines of star (Note 4) 

18668 v0 double[3] direction cosines of tangent point (Note 4) 

18669 

18670 Returned: 

18671 *xi,*eta double tangent plane coordinates of star 

18672 

18673 Returned (function value): 

18674 int status: 0 = OK 

18675 1 = star too far from axis 

18676 2 = antistar on tangent plane 

18677 3 = antistar too far from axis 

18678 

18679 Notes: 

18680 

18681 1) The tangent plane projection is also called the "gnomonic 

18682 projection" and the "central projection". 

18683 

18684 2) The eta axis points due north in the adopted coordinate system. 

18685 If the direction cosines represent observed (RA,Dec), the tangent 

18686 plane coordinates (xi,eta) are conventionally called the 

18687 "standard coordinates". If the direction cosines are with 

18688 respect to a right-handed triad, (xi,eta) are also right-handed. 

18689 The units of (xi,eta) are, effectively, radians at the tangent 

18690 point. 

18691 

18692 3) The method used is to extend the star vector to the tangent 

18693 plane and then rotate the triad so that (x,y) becomes (xi,eta). 

18694 Writing (a,b) for the celestial spherical coordinates of the 

18695 star, the sequence of rotations is (a+pi/2) around the z-axis 

18696 followed by (pi/2-b) around the x-axis. 

18697 

18698 4) If vector v0 is not of unit length, or if vector v is of zero 

18699 length, the results will be wrong. 

18700 

18701 5) If v0 points at a pole, the returned (xi,eta) will be based on 

18702 the arbitrary assumption that the longitude coordinate of the 

18703 tangent point is zero. 

18704 

18705 6) This function is a member of the following set: 

18706 

18707 spherical vector solve for 

18708 

18709 eraTpxes > eraTpxev < xi,eta 

18710 eraTpsts eraTpstv star 

18711 eraTpors eraTporv origin 

18712 

18713 References: 

18714 

18715 Calabretta M.R. & Greisen, E.W., 2002, "Representations of 

18716 celestial coordinates in FITS", Astron.Astrophys. 395, 1077 

18717 

18718 Green, R.M., "Spherical Astronomy", Cambridge University Press, 

18719 1987, Chapter 13. 

18720 

18721 This revision: 2018 January 2 

18722 

18723 Copyright (C) 2013-2021, NumFOCUS Foundation. 

18724 Derived, with permission, from the SOFA library. See notes at end of file. 

18725 

18726 """ 

18727 xi, eta, c_retval = ufunc.tpxev(v, v0) 

18728 check_errwarn(c_retval, 'tpxev') 

18729 return xi, eta 

18730 

18731 

18732STATUS_CODES['tpxev'] = { 

18733 0: 'OK', 

18734 1: 'star too far from axis', 

18735 2: 'antistar on tangent plane', 

18736 3: 'antistar too far from axis', 

18737} 

18738 

18739 

18740def a2af(ndp, angle): 

18741 """ 

18742 Decompose radians into degrees, arcminutes, arcseconds, fraction. 

18743 

18744 Parameters 

18745 ---------- 

18746 ndp : int array 

18747 angle : double array 

18748 

18749 Returns 

18750 ------- 

18751 sign : char array 

18752 idmsf : int array 

18753 

18754 Notes 

18755 ----- 

18756 Wraps ERFA function ``eraA2af``. The ERFA documentation is:: 

18757 

18758 - - - - - - - - 

18759 e r a A 2 a f 

18760 - - - - - - - - 

18761 

18762 Decompose radians into degrees, arcminutes, arcseconds, fraction. 

18763 

18764 Given: 

18765 ndp int resolution (Note 1) 

18766 angle double angle in radians 

18767 

18768 Returned: 

18769 sign char '+' or '-' 

18770 idmsf int[4] degrees, arcminutes, arcseconds, fraction 

18771 

18772 Notes: 

18773 

18774 1) The argument ndp is interpreted as follows: 

18775 

18776 ndp resolution 

18777 : ...0000 00 00 

18778 -7 1000 00 00 

18779 -6 100 00 00 

18780 -5 10 00 00 

18781 -4 1 00 00 

18782 -3 0 10 00 

18783 -2 0 01 00 

18784 -1 0 00 10 

18785 0 0 00 01 

18786 1 0 00 00.1 

18787 2 0 00 00.01 

18788 3 0 00 00.001 

18789 : 0 00 00.000... 

18790 

18791 2) The largest positive useful value for ndp is determined by the 

18792 size of angle, the format of doubles on the target platform, and 

18793 the risk of overflowing idmsf[3]. On a typical platform, for 

18794 angle up to 2pi, the available floating-point precision might 

18795 correspond to ndp=12. However, the practical limit is typically 

18796 ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is 

18797 only 16 bits. 

18798 

18799 3) The absolute value of angle may exceed 2pi. In cases where it 

18800 does not, it is up to the caller to test for and handle the 

18801 case where angle is very nearly 2pi and rounds up to 360 degrees, 

18802 by testing for idmsf[0]=360 and setting idmsf[0-3] to zero. 

18803 

18804 Called: 

18805 eraD2tf decompose days to hms 

18806 

18807 This revision: 2021 May 11 

18808 

18809 Copyright (C) 2013-2021, NumFOCUS Foundation. 

18810 Derived, with permission, from the SOFA library. See notes at end of file. 

18811 

18812 """ 

18813 sign, idmsf = ufunc.a2af(ndp, angle) 

18814 sign = sign.view(dt_bytes1) 

18815 return sign, idmsf 

18816 

18817 

18818def a2tf(ndp, angle): 

18819 """ 

18820 Decompose radians into hours, minutes, seconds, fraction. 

18821 

18822 Parameters 

18823 ---------- 

18824 ndp : int array 

18825 angle : double array 

18826 

18827 Returns 

18828 ------- 

18829 sign : char array 

18830 ihmsf : int array 

18831 

18832 Notes 

18833 ----- 

18834 Wraps ERFA function ``eraA2tf``. The ERFA documentation is:: 

18835 

18836 - - - - - - - - 

18837 e r a A 2 t f 

18838 - - - - - - - - 

18839 

18840 Decompose radians into hours, minutes, seconds, fraction. 

18841 

18842 Given: 

18843 ndp int resolution (Note 1) 

18844 angle double angle in radians 

18845 

18846 Returned: 

18847 sign char '+' or '-' 

18848 ihmsf int[4] hours, minutes, seconds, fraction 

18849 

18850 Notes: 

18851 

18852 1) The argument ndp is interpreted as follows: 

18853 

18854 ndp resolution 

18855 : ...0000 00 00 

18856 -7 1000 00 00 

18857 -6 100 00 00 

18858 -5 10 00 00 

18859 -4 1 00 00 

18860 -3 0 10 00 

18861 -2 0 01 00 

18862 -1 0 00 10 

18863 0 0 00 01 

18864 1 0 00 00.1 

18865 2 0 00 00.01 

18866 3 0 00 00.001 

18867 : 0 00 00.000... 

18868 

18869 2) The largest positive useful value for ndp is determined by the 

18870 size of angle, the format of doubles on the target platform, and 

18871 the risk of overflowing ihmsf[3]. On a typical platform, for 

18872 angle up to 2pi, the available floating-point precision might 

18873 correspond to ndp=12. However, the practical limit is typically 

18874 ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is 

18875 only 16 bits. 

18876 

18877 3) The absolute value of angle may exceed 2pi. In cases where it 

18878 does not, it is up to the caller to test for and handle the 

18879 case where angle is very nearly 2pi and rounds up to 24 hours, 

18880 by testing for ihmsf[0]=24 and setting ihmsf[0-3] to zero. 

18881 

18882 Called: 

18883 eraD2tf decompose days to hms 

18884 

18885 This revision: 2021 May 11 

18886 

18887 Copyright (C) 2013-2021, NumFOCUS Foundation. 

18888 Derived, with permission, from the SOFA library. See notes at end of file. 

18889 

18890 """ 

18891 sign, ihmsf = ufunc.a2tf(ndp, angle) 

18892 sign = sign.view(dt_bytes1) 

18893 return sign, ihmsf 

18894 

18895 

18896def af2a(s, ideg, iamin, asec): 

18897 """ 

18898 Convert degrees, arcminutes, arcseconds to radians. 

18899 

18900 Parameters 

18901 ---------- 

18902 s : char array 

18903 ideg : int array 

18904 iamin : int array 

18905 asec : double array 

18906 

18907 Returns 

18908 ------- 

18909 rad : double array 

18910 

18911 Notes 

18912 ----- 

18913 Wraps ERFA function ``eraAf2a``. The ERFA documentation is:: 

18914 

18915 - - - - - - - - 

18916 e r a A f 2 a 

18917 - - - - - - - - 

18918 

18919 Convert degrees, arcminutes, arcseconds to radians. 

18920 

18921 Given: 

18922 s char sign: '-' = negative, otherwise positive 

18923 ideg int degrees 

18924 iamin int arcminutes 

18925 asec double arcseconds 

18926 

18927 Returned: 

18928 rad double angle in radians 

18929 

18930 Returned (function value): 

18931 int status: 0 = OK 

18932 1 = ideg outside range 0-359 

18933 2 = iamin outside range 0-59 

18934 3 = asec outside range 0-59.999... 

18935 

18936 Notes: 

18937 

18938 1) The result is computed even if any of the range checks fail. 

18939 

18940 2) Negative ideg, iamin and/or asec produce a warning status, but 

18941 the absolute value is used in the conversion. 

18942 

18943 3) If there are multiple errors, the status value reflects only the 

18944 first, the smallest taking precedence. 

18945 

18946 This revision: 2021 May 11 

18947 

18948 Copyright (C) 2013-2021, NumFOCUS Foundation. 

18949 Derived, with permission, from the SOFA library. See notes at end of file. 

18950 

18951 """ 

18952 rad, c_retval = ufunc.af2a(s, ideg, iamin, asec) 

18953 check_errwarn(c_retval, 'af2a') 

18954 return rad 

18955 

18956 

18957STATUS_CODES['af2a'] = { 

18958 0: 'OK', 

18959 1: 'ideg outside range 0-359', 

18960 2: 'iamin outside range 0-59', 

18961 3: 'asec outside range 0-59.999...', 

18962} 

18963 

18964 

18965def anp(a): 

18966 """ 

18967 Normalize angle into the range 0 <= a < 2pi. 

18968 

18969 Parameters 

18970 ---------- 

18971 a : double array 

18972 

18973 Returns 

18974 ------- 

18975 c_retval : double array 

18976 

18977 Notes 

18978 ----- 

18979 Wraps ERFA function ``eraAnp``. The ERFA documentation is:: 

18980 

18981 - - - - - - - 

18982 e r a A n p 

18983 - - - - - - - 

18984 

18985 Normalize angle into the range 0 <= a < 2pi. 

18986 

18987 Given: 

18988 a double angle (radians) 

18989 

18990 Returned (function value): 

18991 double angle in range 0-2pi 

18992 

18993 This revision: 2021 May 11 

18994 

18995 Copyright (C) 2013-2021, NumFOCUS Foundation. 

18996 Derived, with permission, from the SOFA library. See notes at end of file. 

18997 

18998 """ 

18999 c_retval = ufunc.anp(a) 

19000 return c_retval 

19001 

19002 

19003def anpm(a): 

19004 """ 

19005 Normalize angle into the range -pi <= a < +pi. 

19006 

19007 Parameters 

19008 ---------- 

19009 a : double array 

19010 

19011 Returns 

19012 ------- 

19013 c_retval : double array 

19014 

19015 Notes 

19016 ----- 

19017 Wraps ERFA function ``eraAnpm``. The ERFA documentation is:: 

19018 

19019 - - - - - - - - 

19020 e r a A n p m 

19021 - - - - - - - - 

19022 

19023 Normalize angle into the range -pi <= a < +pi. 

19024 

19025 Given: 

19026 a double angle (radians) 

19027 

19028 Returned (function value): 

19029 double angle in range +/-pi 

19030 

19031 This revision: 2021 May 11 

19032 

19033 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19034 Derived, with permission, from the SOFA library. See notes at end of file. 

19035 

19036 """ 

19037 c_retval = ufunc.anpm(a) 

19038 return c_retval 

19039 

19040 

19041def d2tf(ndp, days): 

19042 """ 

19043 Decompose days to hours, minutes, seconds, fraction. 

19044 

19045 Parameters 

19046 ---------- 

19047 ndp : int array 

19048 days : double array 

19049 

19050 Returns 

19051 ------- 

19052 sign : char array 

19053 ihmsf : int array 

19054 

19055 Notes 

19056 ----- 

19057 Wraps ERFA function ``eraD2tf``. The ERFA documentation is:: 

19058 

19059 - - - - - - - - 

19060 e r a D 2 t f 

19061 - - - - - - - - 

19062 

19063 Decompose days to hours, minutes, seconds, fraction. 

19064 

19065 Given: 

19066 ndp int resolution (Note 1) 

19067 days double interval in days 

19068 

19069 Returned: 

19070 sign char '+' or '-' 

19071 ihmsf int[4] hours, minutes, seconds, fraction 

19072 

19073 Notes: 

19074 

19075 1) The argument ndp is interpreted as follows: 

19076 

19077 ndp resolution 

19078 : ...0000 00 00 

19079 -7 1000 00 00 

19080 -6 100 00 00 

19081 -5 10 00 00 

19082 -4 1 00 00 

19083 -3 0 10 00 

19084 -2 0 01 00 

19085 -1 0 00 10 

19086 0 0 00 01 

19087 1 0 00 00.1 

19088 2 0 00 00.01 

19089 3 0 00 00.001 

19090 : 0 00 00.000... 

19091 

19092 2) The largest positive useful value for ndp is determined by the 

19093 size of days, the format of double on the target platform, and 

19094 the risk of overflowing ihmsf[3]. On a typical platform, for 

19095 days up to 1.0, the available floating-point precision might 

19096 correspond to ndp=12. However, the practical limit is typically 

19097 ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is 

19098 only 16 bits. 

19099 

19100 3) The absolute value of days may exceed 1.0. In cases where it 

19101 does not, it is up to the caller to test for and handle the 

19102 case where days is very nearly 1.0 and rounds up to 24 hours, 

19103 by testing for ihmsf[0]=24 and setting ihmsf[0-3] to zero. 

19104 

19105 This revision: 2021 May 11 

19106 

19107 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19108 Derived, with permission, from the SOFA library. See notes at end of file. 

19109 

19110 """ 

19111 sign, ihmsf = ufunc.d2tf(ndp, days) 

19112 sign = sign.view(dt_bytes1) 

19113 return sign, ihmsf 

19114 

19115 

19116def tf2a(s, ihour, imin, sec): 

19117 """ 

19118 Convert hours, minutes, seconds to radians. 

19119 

19120 Parameters 

19121 ---------- 

19122 s : char array 

19123 ihour : int array 

19124 imin : int array 

19125 sec : double array 

19126 

19127 Returns 

19128 ------- 

19129 rad : double array 

19130 

19131 Notes 

19132 ----- 

19133 Wraps ERFA function ``eraTf2a``. The ERFA documentation is:: 

19134 

19135 - - - - - - - - 

19136 e r a T f 2 a 

19137 - - - - - - - - 

19138 

19139 Convert hours, minutes, seconds to radians. 

19140 

19141 Given: 

19142 s char sign: '-' = negative, otherwise positive 

19143 ihour int hours 

19144 imin int minutes 

19145 sec double seconds 

19146 

19147 Returned: 

19148 rad double angle in radians 

19149 

19150 Returned (function value): 

19151 int status: 0 = OK 

19152 1 = ihour outside range 0-23 

19153 2 = imin outside range 0-59 

19154 3 = sec outside range 0-59.999... 

19155 

19156 Notes: 

19157 

19158 1) The result is computed even if any of the range checks fail. 

19159 

19160 2) Negative ihour, imin and/or sec produce a warning status, but 

19161 the absolute value is used in the conversion. 

19162 

19163 3) If there are multiple errors, the status value reflects only the 

19164 first, the smallest taking precedence. 

19165 

19166 This revision: 2021 May 11 

19167 

19168 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19169 Derived, with permission, from the SOFA library. See notes at end of file. 

19170 

19171 """ 

19172 rad, c_retval = ufunc.tf2a(s, ihour, imin, sec) 

19173 check_errwarn(c_retval, 'tf2a') 

19174 return rad 

19175 

19176 

19177STATUS_CODES['tf2a'] = { 

19178 0: 'OK', 

19179 1: 'ihour outside range 0-23', 

19180 2: 'imin outside range 0-59', 

19181 3: 'sec outside range 0-59.999...', 

19182} 

19183 

19184 

19185def tf2d(s, ihour, imin, sec): 

19186 """ 

19187 Convert hours, minutes, seconds to days. 

19188 

19189 Parameters 

19190 ---------- 

19191 s : char array 

19192 ihour : int array 

19193 imin : int array 

19194 sec : double array 

19195 

19196 Returns 

19197 ------- 

19198 days : double array 

19199 

19200 Notes 

19201 ----- 

19202 Wraps ERFA function ``eraTf2d``. The ERFA documentation is:: 

19203 

19204 - - - - - - - - 

19205 e r a T f 2 d 

19206 - - - - - - - - 

19207 

19208 Convert hours, minutes, seconds to days. 

19209 

19210 Given: 

19211 s char sign: '-' = negative, otherwise positive 

19212 ihour int hours 

19213 imin int minutes 

19214 sec double seconds 

19215 

19216 Returned: 

19217 days double interval in days 

19218 

19219 Returned (function value): 

19220 int status: 0 = OK 

19221 1 = ihour outside range 0-23 

19222 2 = imin outside range 0-59 

19223 3 = sec outside range 0-59.999... 

19224 

19225 Notes: 

19226 

19227 1) The result is computed even if any of the range checks fail. 

19228 

19229 2) Negative ihour, imin and/or sec produce a warning status, but 

19230 the absolute value is used in the conversion. 

19231 

19232 3) If there are multiple errors, the status value reflects only the 

19233 first, the smallest taking precedence. 

19234 

19235 This revision: 2021 May 11 

19236 

19237 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19238 Derived, with permission, from the SOFA library. See notes at end of file. 

19239 

19240 """ 

19241 days, c_retval = ufunc.tf2d(s, ihour, imin, sec) 

19242 check_errwarn(c_retval, 'tf2d') 

19243 return days 

19244 

19245 

19246STATUS_CODES['tf2d'] = { 

19247 0: 'OK', 

19248 1: 'ihour outside range 0-23', 

19249 2: 'imin outside range 0-59', 

19250 3: 'sec outside range 0-59.999...', 

19251} 

19252 

19253 

19254def rx(phi, r): 

19255 """ 

19256 Rotate an r-matrix about the x-axis. 

19257 

19258 Parameters 

19259 ---------- 

19260 phi : double array 

19261 r : double array 

19262 

19263 Returns 

19264 ------- 

19265 r : double array 

19266 

19267 Notes 

19268 ----- 

19269 Wraps ERFA function ``eraRx``. Note that, unlike the erfa routine, 

19270 the python wrapper does not change r in-place. The ERFA documentation is:: 

19271 

19272 - - - - - - 

19273 e r a R x 

19274 - - - - - - 

19275 

19276 Rotate an r-matrix about the x-axis. 

19277 

19278 Given: 

19279 phi double angle (radians) 

19280 

19281 Given and returned: 

19282 r double[3][3] r-matrix, rotated 

19283 

19284 Notes: 

19285 

19286 1) Calling this function with positive phi incorporates in the 

19287 supplied r-matrix r an additional rotation, about the x-axis, 

19288 anticlockwise as seen looking towards the origin from positive x. 

19289 

19290 2) The additional rotation can be represented by this matrix: 

19291 

19292 ( 1 0 0 ) 

19293 ( ) 

19294 ( 0 + cos(phi) + sin(phi) ) 

19295 ( ) 

19296 ( 0 - sin(phi) + cos(phi) ) 

19297 

19298 This revision: 2021 May 11 

19299 

19300 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19301 Derived, with permission, from the SOFA library. See notes at end of file. 

19302 

19303 """ 

19304 r = ufunc.rx(phi, r) 

19305 return r 

19306 

19307 

19308def ry(theta, r): 

19309 """ 

19310 Rotate an r-matrix about the y-axis. 

19311 

19312 Parameters 

19313 ---------- 

19314 theta : double array 

19315 r : double array 

19316 

19317 Returns 

19318 ------- 

19319 r : double array 

19320 

19321 Notes 

19322 ----- 

19323 Wraps ERFA function ``eraRy``. Note that, unlike the erfa routine, 

19324 the python wrapper does not change r in-place. The ERFA documentation is:: 

19325 

19326 - - - - - - 

19327 e r a R y 

19328 - - - - - - 

19329 

19330 Rotate an r-matrix about the y-axis. 

19331 

19332 Given: 

19333 theta double angle (radians) 

19334 

19335 Given and returned: 

19336 r double[3][3] r-matrix, rotated 

19337 

19338 Notes: 

19339 

19340 1) Calling this function with positive theta incorporates in the 

19341 supplied r-matrix r an additional rotation, about the y-axis, 

19342 anticlockwise as seen looking towards the origin from positive y. 

19343 

19344 2) The additional rotation can be represented by this matrix: 

19345 

19346 ( + cos(theta) 0 - sin(theta) ) 

19347 ( ) 

19348 ( 0 1 0 ) 

19349 ( ) 

19350 ( + sin(theta) 0 + cos(theta) ) 

19351 

19352 This revision: 2021 May 11 

19353 

19354 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19355 Derived, with permission, from the SOFA library. See notes at end of file. 

19356 

19357 """ 

19358 r = ufunc.ry(theta, r) 

19359 return r 

19360 

19361 

19362def rz(psi, r): 

19363 """ 

19364 Rotate an r-matrix about the z-axis. 

19365 

19366 Parameters 

19367 ---------- 

19368 psi : double array 

19369 r : double array 

19370 

19371 Returns 

19372 ------- 

19373 r : double array 

19374 

19375 Notes 

19376 ----- 

19377 Wraps ERFA function ``eraRz``. Note that, unlike the erfa routine, 

19378 the python wrapper does not change r in-place. The ERFA documentation is:: 

19379 

19380 - - - - - - 

19381 e r a R z 

19382 - - - - - - 

19383 

19384 Rotate an r-matrix about the z-axis. 

19385 

19386 Given: 

19387 psi double angle (radians) 

19388 

19389 Given and returned: 

19390 r double[3][3] r-matrix, rotated 

19391 

19392 Notes: 

19393 

19394 1) Calling this function with positive psi incorporates in the 

19395 supplied r-matrix r an additional rotation, about the z-axis, 

19396 anticlockwise as seen looking towards the origin from positive z. 

19397 

19398 2) The additional rotation can be represented by this matrix: 

19399 

19400 ( + cos(psi) + sin(psi) 0 ) 

19401 ( ) 

19402 ( - sin(psi) + cos(psi) 0 ) 

19403 ( ) 

19404 ( 0 0 1 ) 

19405 

19406 This revision: 2021 May 11 

19407 

19408 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19409 Derived, with permission, from the SOFA library. See notes at end of file. 

19410 

19411 """ 

19412 r = ufunc.rz(psi, r) 

19413 return r 

19414 

19415 

19416def cp(p): 

19417 """ 

19418 Copy a p-vector. 

19419 

19420 Parameters 

19421 ---------- 

19422 p : double array 

19423 

19424 Returns 

19425 ------- 

19426 c : double array 

19427 

19428 Notes 

19429 ----- 

19430 Wraps ERFA function ``eraCp``. The ERFA documentation is:: 

19431 

19432 - - - - - - 

19433 e r a C p 

19434 - - - - - - 

19435 

19436 Copy a p-vector. 

19437 

19438 Given: 

19439 p double[3] p-vector to be copied 

19440 

19441 Returned: 

19442 c double[3] copy 

19443 

19444 This revision: 2021 May 11 

19445 

19446 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19447 Derived, with permission, from the SOFA library. See notes at end of file. 

19448 

19449 """ 

19450 c = ufunc.cp(p) 

19451 return c 

19452 

19453 

19454def cpv(pv): 

19455 """ 

19456 Copy a position/velocity vector. 

19457 

19458 Parameters 

19459 ---------- 

19460 pv : double array 

19461 

19462 Returns 

19463 ------- 

19464 c : double array 

19465 

19466 Notes 

19467 ----- 

19468 Wraps ERFA function ``eraCpv``. The ERFA documentation is:: 

19469 

19470 - - - - - - - 

19471 e r a C p v 

19472 - - - - - - - 

19473 

19474 Copy a position/velocity vector. 

19475 

19476 Given: 

19477 pv double[2][3] position/velocity vector to be copied 

19478 

19479 Returned: 

19480 c double[2][3] copy 

19481 

19482 Called: 

19483 eraCp copy p-vector 

19484 

19485 This revision: 2021 May 11 

19486 

19487 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19488 Derived, with permission, from the SOFA library. See notes at end of file. 

19489 

19490 """ 

19491 c = ufunc.cpv(pv) 

19492 return c 

19493 

19494 

19495def cr(r): 

19496 """ 

19497 Copy an r-matrix. 

19498 

19499 Parameters 

19500 ---------- 

19501 r : double array 

19502 

19503 Returns 

19504 ------- 

19505 c : double array 

19506 

19507 Notes 

19508 ----- 

19509 Wraps ERFA function ``eraCr``. The ERFA documentation is:: 

19510 

19511 - - - - - - 

19512 e r a C r 

19513 - - - - - - 

19514 

19515 Copy an r-matrix. 

19516 

19517 Given: 

19518 r double[3][3] r-matrix to be copied 

19519 

19520 Returned: 

19521 c double[3][3] copy 

19522 

19523 Called: 

19524 eraCp copy p-vector 

19525 

19526 This revision: 2021 May 11 

19527 

19528 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19529 Derived, with permission, from the SOFA library. See notes at end of file. 

19530 

19531 """ 

19532 c = ufunc.cr(r) 

19533 return c 

19534 

19535 

19536def p2pv(p): 

19537 """ 

19538 Extend a p-vector to a pv-vector by appending a zero velocity. 

19539 

19540 Parameters 

19541 ---------- 

19542 p : double array 

19543 

19544 Returns 

19545 ------- 

19546 pv : double array 

19547 

19548 Notes 

19549 ----- 

19550 Wraps ERFA function ``eraP2pv``. The ERFA documentation is:: 

19551 

19552 - - - - - - - - 

19553 e r a P 2 p v 

19554 - - - - - - - - 

19555 

19556 Extend a p-vector to a pv-vector by appending a zero velocity. 

19557 

19558 Given: 

19559 p double[3] p-vector 

19560 

19561 Returned: 

19562 pv double[2][3] pv-vector 

19563 

19564 Called: 

19565 eraCp copy p-vector 

19566 eraZp zero p-vector 

19567 

19568 This revision: 2021 May 11 

19569 

19570 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19571 Derived, with permission, from the SOFA library. See notes at end of file. 

19572 

19573 """ 

19574 pv = ufunc.p2pv(p) 

19575 return pv 

19576 

19577 

19578def pv2p(pv): 

19579 """ 

19580 Discard velocity component of a pv-vector. 

19581 

19582 Parameters 

19583 ---------- 

19584 pv : double array 

19585 

19586 Returns 

19587 ------- 

19588 p : double array 

19589 

19590 Notes 

19591 ----- 

19592 Wraps ERFA function ``eraPv2p``. The ERFA documentation is:: 

19593 

19594 - - - - - - - - 

19595 e r a P v 2 p 

19596 - - - - - - - - 

19597 

19598 Discard velocity component of a pv-vector. 

19599 

19600 Given: 

19601 pv double[2][3] pv-vector 

19602 

19603 Returned: 

19604 p double[3] p-vector 

19605 

19606 Called: 

19607 eraCp copy p-vector 

19608 

19609 This revision: 2021 May 11 

19610 

19611 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19612 Derived, with permission, from the SOFA library. See notes at end of file. 

19613 

19614 """ 

19615 p = ufunc.pv2p(pv) 

19616 return p 

19617 

19618 

19619def ir(): 

19620 """ 

19621 Initialize an r-matrix to the identity matrix. 

19622 

19623 Returns 

19624 ------- 

19625 r : double array 

19626 

19627 Notes 

19628 ----- 

19629 Wraps ERFA function ``eraIr``. The ERFA documentation is:: 

19630 

19631 - - - - - - 

19632 e r a I r 

19633 - - - - - - 

19634 

19635 Initialize an r-matrix to the identity matrix. 

19636 

19637 Returned: 

19638 r double[3][3] r-matrix 

19639 

19640 This revision: 2021 May 11 

19641 

19642 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19643 Derived, with permission, from the SOFA library. See notes at end of file. 

19644 

19645 """ 

19646 r = ufunc.ir() 

19647 return r 

19648 

19649 

19650def zp(): 

19651 """ 

19652 Zero a p-vector. 

19653 

19654 Returns 

19655 ------- 

19656 p : double array 

19657 

19658 Notes 

19659 ----- 

19660 Wraps ERFA function ``eraZp``. The ERFA documentation is:: 

19661 

19662 - - - - - - 

19663 e r a Z p 

19664 - - - - - - 

19665 

19666 Zero a p-vector. 

19667 

19668 Returned: 

19669 p double[3] zero p-vector 

19670 

19671 This revision: 2021 May 11 

19672 

19673 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19674 Derived, with permission, from the SOFA library. See notes at end of file. 

19675 

19676 """ 

19677 p = ufunc.zp() 

19678 return p 

19679 

19680 

19681def zpv(): 

19682 """ 

19683 Zero a pv-vector. 

19684 

19685 Returns 

19686 ------- 

19687 pv : double array 

19688 

19689 Notes 

19690 ----- 

19691 Wraps ERFA function ``eraZpv``. The ERFA documentation is:: 

19692 

19693 - - - - - - - 

19694 e r a Z p v 

19695 - - - - - - - 

19696 

19697 Zero a pv-vector. 

19698 

19699 Returned: 

19700 pv double[2][3] zero pv-vector 

19701 

19702 Called: 

19703 eraZp zero p-vector 

19704 

19705 This revision: 2021 May 11 

19706 

19707 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19708 Derived, with permission, from the SOFA library. See notes at end of file. 

19709 

19710 """ 

19711 pv = ufunc.zpv() 

19712 return pv 

19713 

19714 

19715def zr(): 

19716 """ 

19717 Initialize an r-matrix to the null matrix. 

19718 

19719 Returns 

19720 ------- 

19721 r : double array 

19722 

19723 Notes 

19724 ----- 

19725 Wraps ERFA function ``eraZr``. The ERFA documentation is:: 

19726 

19727 - - - - - - 

19728 e r a Z r 

19729 - - - - - - 

19730 

19731 Initialize an r-matrix to the null matrix. 

19732 

19733 Returned: 

19734 r double[3][3] r-matrix 

19735 

19736 This revision: 2021 May 11 

19737 

19738 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19739 Derived, with permission, from the SOFA library. See notes at end of file. 

19740 

19741 """ 

19742 r = ufunc.zr() 

19743 return r 

19744 

19745 

19746def rxr(a, b): 

19747 """ 

19748 Multiply two r-matrices. 

19749 

19750 Parameters 

19751 ---------- 

19752 a : double array 

19753 b : double array 

19754 

19755 Returns 

19756 ------- 

19757 atb : double array 

19758 

19759 Notes 

19760 ----- 

19761 Wraps ERFA function ``eraRxr``. The ERFA documentation is:: 

19762 

19763 - - - - - - - 

19764 e r a R x r 

19765 - - - - - - - 

19766 

19767 Multiply two r-matrices. 

19768 

19769 Given: 

19770 a double[3][3] first r-matrix 

19771 b double[3][3] second r-matrix 

19772 

19773 Returned: 

19774 atb double[3][3] a * b 

19775 

19776 Note: 

19777 It is permissible to re-use the same array for any of the 

19778 arguments. 

19779 

19780 Called: 

19781 eraCr copy r-matrix 

19782 

19783 This revision: 2021 May 11 

19784 

19785 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19786 Derived, with permission, from the SOFA library. See notes at end of file. 

19787 

19788 """ 

19789 atb = ufunc.rxr(a, b) 

19790 return atb 

19791 

19792 

19793def tr(r): 

19794 """ 

19795 Transpose an r-matrix. 

19796 

19797 Parameters 

19798 ---------- 

19799 r : double array 

19800 

19801 Returns 

19802 ------- 

19803 rt : double array 

19804 

19805 Notes 

19806 ----- 

19807 Wraps ERFA function ``eraTr``. The ERFA documentation is:: 

19808 

19809 - - - - - - 

19810 e r a T r 

19811 - - - - - - 

19812 

19813 Transpose an r-matrix. 

19814 

19815 Given: 

19816 r double[3][3] r-matrix 

19817 

19818 Returned: 

19819 rt double[3][3] transpose 

19820 

19821 Note: 

19822 It is permissible for r and rt to be the same array. 

19823 

19824 Called: 

19825 eraCr copy r-matrix 

19826 

19827 This revision: 2021 May 11 

19828 

19829 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19830 Derived, with permission, from the SOFA library. See notes at end of file. 

19831 

19832 """ 

19833 rt = ufunc.tr(r) 

19834 return rt 

19835 

19836 

19837def rxp(r, p): 

19838 """ 

19839 Multiply a p-vector by an r-matrix. 

19840 

19841 Parameters 

19842 ---------- 

19843 r : double array 

19844 p : double array 

19845 

19846 Returns 

19847 ------- 

19848 rp : double array 

19849 

19850 Notes 

19851 ----- 

19852 Wraps ERFA function ``eraRxp``. The ERFA documentation is:: 

19853 

19854 - - - - - - - 

19855 e r a R x p 

19856 - - - - - - - 

19857 

19858 Multiply a p-vector by an r-matrix. 

19859 

19860 Given: 

19861 r double[3][3] r-matrix 

19862 p double[3] p-vector 

19863 

19864 Returned: 

19865 rp double[3] r * p 

19866 

19867 Note: 

19868 It is permissible for p and rp to be the same array. 

19869 

19870 Called: 

19871 eraCp copy p-vector 

19872 

19873 This revision: 2021 May 11 

19874 

19875 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19876 Derived, with permission, from the SOFA library. See notes at end of file. 

19877 

19878 """ 

19879 rp = ufunc.rxp(r, p) 

19880 return rp 

19881 

19882 

19883def rxpv(r, pv): 

19884 """ 

19885 Multiply a pv-vector by an r-matrix. 

19886 

19887 Parameters 

19888 ---------- 

19889 r : double array 

19890 pv : double array 

19891 

19892 Returns 

19893 ------- 

19894 rpv : double array 

19895 

19896 Notes 

19897 ----- 

19898 Wraps ERFA function ``eraRxpv``. The ERFA documentation is:: 

19899 

19900 - - - - - - - - 

19901 e r a R x p v 

19902 - - - - - - - - 

19903 

19904 Multiply a pv-vector by an r-matrix. 

19905 

19906 Given: 

19907 r double[3][3] r-matrix 

19908 pv double[2][3] pv-vector 

19909 

19910 Returned: 

19911 rpv double[2][3] r * pv 

19912 

19913 Notes: 

19914 

19915 1) The algorithm is for the simple case where the r-matrix r is not 

19916 a function of time. The case where r is a function of time leads 

19917 to an additional velocity component equal to the product of the 

19918 derivative of r and the position vector. 

19919 

19920 2) It is permissible for pv and rpv to be the same array. 

19921 

19922 Called: 

19923 eraRxp product of r-matrix and p-vector 

19924 

19925 This revision: 2021 May 11 

19926 

19927 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19928 Derived, with permission, from the SOFA library. See notes at end of file. 

19929 

19930 """ 

19931 rpv = ufunc.rxpv(r, pv) 

19932 return rpv 

19933 

19934 

19935def trxp(r, p): 

19936 """ 

19937 Multiply a p-vector by the transpose of an r-matrix. 

19938 

19939 Parameters 

19940 ---------- 

19941 r : double array 

19942 p : double array 

19943 

19944 Returns 

19945 ------- 

19946 trp : double array 

19947 

19948 Notes 

19949 ----- 

19950 Wraps ERFA function ``eraTrxp``. The ERFA documentation is:: 

19951 

19952 - - - - - - - - 

19953 e r a T r x p 

19954 - - - - - - - - 

19955 

19956 Multiply a p-vector by the transpose of an r-matrix. 

19957 

19958 Given: 

19959 r double[3][3] r-matrix 

19960 p double[3] p-vector 

19961 

19962 Returned: 

19963 trp double[3] r^T * p 

19964 

19965 Note: 

19966 It is permissible for p and trp to be the same array. 

19967 

19968 Called: 

19969 eraTr transpose r-matrix 

19970 eraRxp product of r-matrix and p-vector 

19971 

19972 This revision: 2021 May 11 

19973 

19974 Copyright (C) 2013-2021, NumFOCUS Foundation. 

19975 Derived, with permission, from the SOFA library. See notes at end of file. 

19976 

19977 """ 

19978 trp = ufunc.trxp(r, p) 

19979 return trp 

19980 

19981 

19982def trxpv(r, pv): 

19983 """ 

19984 Multiply a pv-vector by the transpose of an r-matrix. 

19985 

19986 Parameters 

19987 ---------- 

19988 r : double array 

19989 pv : double array 

19990 

19991 Returns 

19992 ------- 

19993 trpv : double array 

19994 

19995 Notes 

19996 ----- 

19997 Wraps ERFA function ``eraTrxpv``. The ERFA documentation is:: 

19998 

19999 - - - - - - - - - 

20000 e r a T r x p v 

20001 - - - - - - - - - 

20002 

20003 Multiply a pv-vector by the transpose of an r-matrix. 

20004 

20005 Given: 

20006 r double[3][3] r-matrix 

20007 pv double[2][3] pv-vector 

20008 

20009 Returned: 

20010 trpv double[2][3] r^T * pv 

20011 

20012 Notes: 

20013 

20014 1) The algorithm is for the simple case where the r-matrix r is not 

20015 a function of time. The case where r is a function of time leads 

20016 to an additional velocity component equal to the product of the 

20017 derivative of the transpose of r and the position vector. 

20018 

20019 2) It is permissible for pv and rpv to be the same array. 

20020 

20021 Called: 

20022 eraTr transpose r-matrix 

20023 eraRxpv product of r-matrix and pv-vector 

20024 

20025 This revision: 2021 May 11 

20026 

20027 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20028 Derived, with permission, from the SOFA library. See notes at end of file. 

20029 

20030 """ 

20031 trpv = ufunc.trxpv(r, pv) 

20032 return trpv 

20033 

20034 

20035def rm2v(r): 

20036 """ 

20037 Express an r-matrix as an r-vector. 

20038 

20039 Parameters 

20040 ---------- 

20041 r : double array 

20042 

20043 Returns 

20044 ------- 

20045 w : double array 

20046 

20047 Notes 

20048 ----- 

20049 Wraps ERFA function ``eraRm2v``. The ERFA documentation is:: 

20050 

20051 - - - - - - - - 

20052 e r a R m 2 v 

20053 - - - - - - - - 

20054 

20055 Express an r-matrix as an r-vector. 

20056 

20057 Given: 

20058 r double[3][3] rotation matrix 

20059 

20060 Returned: 

20061 w double[3] rotation vector (Note 1) 

20062 

20063 Notes: 

20064 

20065 1) A rotation matrix describes a rotation through some angle about 

20066 some arbitrary axis called the Euler axis. The "rotation vector" 

20067 returned by this function has the same direction as the Euler axis, 

20068 and its magnitude is the angle in radians. (The magnitude and 

20069 direction can be separated by means of the function eraPn.) 

20070 

20071 2) If r is null, so is the result. If r is not a rotation matrix 

20072 the result is undefined; r must be proper (i.e. have a positive 

20073 determinant) and real orthogonal (inverse = transpose). 

20074 

20075 3) The reference frame rotates clockwise as seen looking along 

20076 the rotation vector from the origin. 

20077 

20078 This revision: 2021 May 11 

20079 

20080 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20081 Derived, with permission, from the SOFA library. See notes at end of file. 

20082 

20083 """ 

20084 w = ufunc.rm2v(r) 

20085 return w 

20086 

20087 

20088def rv2m(w): 

20089 """ 

20090 Form the r-matrix corresponding to a given r-vector. 

20091 

20092 Parameters 

20093 ---------- 

20094 w : double array 

20095 

20096 Returns 

20097 ------- 

20098 r : double array 

20099 

20100 Notes 

20101 ----- 

20102 Wraps ERFA function ``eraRv2m``. The ERFA documentation is:: 

20103 

20104 - - - - - - - - 

20105 e r a R v 2 m 

20106 - - - - - - - - 

20107 

20108 Form the r-matrix corresponding to a given r-vector. 

20109 

20110 Given: 

20111 w double[3] rotation vector (Note 1) 

20112 

20113 Returned: 

20114 r double[3][3] rotation matrix 

20115 

20116 Notes: 

20117 

20118 1) A rotation matrix describes a rotation through some angle about 

20119 some arbitrary axis called the Euler axis. The "rotation vector" 

20120 supplied to This function has the same direction as the Euler 

20121 axis, and its magnitude is the angle in radians. 

20122 

20123 2) If w is null, the identity matrix is returned. 

20124 

20125 3) The reference frame rotates clockwise as seen looking along the 

20126 rotation vector from the origin. 

20127 

20128 This revision: 2021 May 11 

20129 

20130 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20131 Derived, with permission, from the SOFA library. See notes at end of file. 

20132 

20133 """ 

20134 r = ufunc.rv2m(w) 

20135 return r 

20136 

20137 

20138def pap(a, b): 

20139 """ 

20140 Position-angle from two p-vectors. 

20141 

20142 Parameters 

20143 ---------- 

20144 a : double array 

20145 b : double array 

20146 

20147 Returns 

20148 ------- 

20149 c_retval : double array 

20150 

20151 Notes 

20152 ----- 

20153 Wraps ERFA function ``eraPap``. The ERFA documentation is:: 

20154 

20155 - - - - - - - 

20156 e r a P a p 

20157 - - - - - - - 

20158 

20159 Position-angle from two p-vectors. 

20160 

20161 Given: 

20162 a double[3] direction of reference point 

20163 b double[3] direction of point whose PA is required 

20164 

20165 Returned (function value): 

20166 double position angle of b with respect to a (radians) 

20167 

20168 Notes: 

20169 

20170 1) The result is the position angle, in radians, of direction b with 

20171 respect to direction a. It is in the range -pi to +pi. The 

20172 sense is such that if b is a small distance "north" of a the 

20173 position angle is approximately zero, and if b is a small 

20174 distance "east" of a the position angle is approximately +pi/2. 

20175 

20176 2) The vectors a and b need not be of unit length. 

20177 

20178 3) Zero is returned if the two directions are the same or if either 

20179 vector is null. 

20180 

20181 4) If vector a is at a pole, the result is ill-defined. 

20182 

20183 Called: 

20184 eraPn decompose p-vector into modulus and direction 

20185 eraPm modulus of p-vector 

20186 eraPxp vector product of two p-vectors 

20187 eraPmp p-vector minus p-vector 

20188 eraPdp scalar product of two p-vectors 

20189 

20190 This revision: 2021 May 11 

20191 

20192 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20193 Derived, with permission, from the SOFA library. See notes at end of file. 

20194 

20195 """ 

20196 c_retval = ufunc.pap(a, b) 

20197 return c_retval 

20198 

20199 

20200def pas(al, ap, bl, bp): 

20201 """ 

20202 Position-angle from spherical coordinates. 

20203 

20204 Parameters 

20205 ---------- 

20206 al : double array 

20207 ap : double array 

20208 bl : double array 

20209 bp : double array 

20210 

20211 Returns 

20212 ------- 

20213 c_retval : double array 

20214 

20215 Notes 

20216 ----- 

20217 Wraps ERFA function ``eraPas``. The ERFA documentation is:: 

20218 

20219 - - - - - - - 

20220 e r a P a s 

20221 - - - - - - - 

20222 

20223 Position-angle from spherical coordinates. 

20224 

20225 Given: 

20226 al double longitude of point A (e.g. RA) in radians 

20227 ap double latitude of point A (e.g. Dec) in radians 

20228 bl double longitude of point B 

20229 bp double latitude of point B 

20230 

20231 Returned (function value): 

20232 double position angle of B with respect to A 

20233 

20234 Notes: 

20235 

20236 1) The result is the bearing (position angle), in radians, of point 

20237 B with respect to point A. It is in the range -pi to +pi. The 

20238 sense is such that if B is a small distance "east" of point A, 

20239 the bearing is approximately +pi/2. 

20240 

20241 2) Zero is returned if the two points are coincident. 

20242 

20243 This revision: 2021 May 11 

20244 

20245 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20246 Derived, with permission, from the SOFA library. See notes at end of file. 

20247 

20248 """ 

20249 c_retval = ufunc.pas(al, ap, bl, bp) 

20250 return c_retval 

20251 

20252 

20253def sepp(a, b): 

20254 """ 

20255 Angular separation between two p-vectors. 

20256 

20257 Parameters 

20258 ---------- 

20259 a : double array 

20260 b : double array 

20261 

20262 Returns 

20263 ------- 

20264 c_retval : double array 

20265 

20266 Notes 

20267 ----- 

20268 Wraps ERFA function ``eraSepp``. The ERFA documentation is:: 

20269 

20270 - - - - - - - - 

20271 e r a S e p p 

20272 - - - - - - - - 

20273 

20274 Angular separation between two p-vectors. 

20275 

20276 Given: 

20277 a double[3] first p-vector (not necessarily unit length) 

20278 b double[3] second p-vector (not necessarily unit length) 

20279 

20280 Returned (function value): 

20281 double angular separation (radians, always positive) 

20282 

20283 Notes: 

20284 

20285 1) If either vector is null, a zero result is returned. 

20286 

20287 2) The angular separation is most simply formulated in terms of 

20288 scalar product. However, this gives poor accuracy for angles 

20289 near zero and pi. The present algorithm uses both cross product 

20290 and dot product, to deliver full accuracy whatever the size of 

20291 the angle. 

20292 

20293 Called: 

20294 eraPxp vector product of two p-vectors 

20295 eraPm modulus of p-vector 

20296 eraPdp scalar product of two p-vectors 

20297 

20298 This revision: 2021 May 11 

20299 

20300 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20301 Derived, with permission, from the SOFA library. See notes at end of file. 

20302 

20303 """ 

20304 c_retval = ufunc.sepp(a, b) 

20305 return c_retval 

20306 

20307 

20308def seps(al, ap, bl, bp): 

20309 """ 

20310 Angular separation between two sets of spherical coordinates. 

20311 

20312 Parameters 

20313 ---------- 

20314 al : double array 

20315 ap : double array 

20316 bl : double array 

20317 bp : double array 

20318 

20319 Returns 

20320 ------- 

20321 c_retval : double array 

20322 

20323 Notes 

20324 ----- 

20325 Wraps ERFA function ``eraSeps``. The ERFA documentation is:: 

20326 

20327 - - - - - - - - 

20328 e r a S e p s 

20329 - - - - - - - - 

20330 

20331 Angular separation between two sets of spherical coordinates. 

20332 

20333 Given: 

20334 al double first longitude (radians) 

20335 ap double first latitude (radians) 

20336 bl double second longitude (radians) 

20337 bp double second latitude (radians) 

20338 

20339 Returned (function value): 

20340 double angular separation (radians) 

20341 

20342 Called: 

20343 eraS2c spherical coordinates to unit vector 

20344 eraSepp angular separation between two p-vectors 

20345 

20346 This revision: 2021 May 11 

20347 

20348 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20349 Derived, with permission, from the SOFA library. See notes at end of file. 

20350 

20351 """ 

20352 c_retval = ufunc.seps(al, ap, bl, bp) 

20353 return c_retval 

20354 

20355 

20356def c2s(p): 

20357 """ 

20358 P-vector to spherical coordinates. 

20359 

20360 Parameters 

20361 ---------- 

20362 p : double array 

20363 

20364 Returns 

20365 ------- 

20366 theta : double array 

20367 phi : double array 

20368 

20369 Notes 

20370 ----- 

20371 Wraps ERFA function ``eraC2s``. The ERFA documentation is:: 

20372 

20373 - - - - - - - 

20374 e r a C 2 s 

20375 - - - - - - - 

20376 

20377 P-vector to spherical coordinates. 

20378 

20379 Given: 

20380 p double[3] p-vector 

20381 

20382 Returned: 

20383 theta double longitude angle (radians) 

20384 phi double latitude angle (radians) 

20385 

20386 Notes: 

20387 

20388 1) The vector p can have any magnitude; only its direction is used. 

20389 

20390 2) If p is null, zero theta and phi are returned. 

20391 

20392 3) At either pole, zero theta is returned. 

20393 

20394 This revision: 2021 May 11 

20395 

20396 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20397 Derived, with permission, from the SOFA library. See notes at end of file. 

20398 

20399 """ 

20400 theta, phi = ufunc.c2s(p) 

20401 return theta, phi 

20402 

20403 

20404def p2s(p): 

20405 """ 

20406 P-vector to spherical polar coordinates. 

20407 

20408 Parameters 

20409 ---------- 

20410 p : double array 

20411 

20412 Returns 

20413 ------- 

20414 theta : double array 

20415 phi : double array 

20416 r : double array 

20417 

20418 Notes 

20419 ----- 

20420 Wraps ERFA function ``eraP2s``. The ERFA documentation is:: 

20421 

20422 - - - - - - - 

20423 e r a P 2 s 

20424 - - - - - - - 

20425 

20426 P-vector to spherical polar coordinates. 

20427 

20428 Given: 

20429 p double[3] p-vector 

20430 

20431 Returned: 

20432 theta double longitude angle (radians) 

20433 phi double latitude angle (radians) 

20434 r double radial distance 

20435 

20436 Notes: 

20437 

20438 1) If P is null, zero theta, phi and r are returned. 

20439 

20440 2) At either pole, zero theta is returned. 

20441 

20442 Called: 

20443 eraC2s p-vector to spherical 

20444 eraPm modulus of p-vector 

20445 

20446 This revision: 2021 May 11 

20447 

20448 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20449 Derived, with permission, from the SOFA library. See notes at end of file. 

20450 

20451 """ 

20452 theta, phi, r = ufunc.p2s(p) 

20453 return theta, phi, r 

20454 

20455 

20456def pv2s(pv): 

20457 """ 

20458 Convert position/velocity from Cartesian to spherical coordinates. 

20459 

20460 Parameters 

20461 ---------- 

20462 pv : double array 

20463 

20464 Returns 

20465 ------- 

20466 theta : double array 

20467 phi : double array 

20468 r : double array 

20469 td : double array 

20470 pd : double array 

20471 rd : double array 

20472 

20473 Notes 

20474 ----- 

20475 Wraps ERFA function ``eraPv2s``. The ERFA documentation is:: 

20476 

20477 - - - - - - - - 

20478 e r a P v 2 s 

20479 - - - - - - - - 

20480 

20481 Convert position/velocity from Cartesian to spherical coordinates. 

20482 

20483 Given: 

20484 pv double[2][3] pv-vector 

20485 

20486 Returned: 

20487 theta double longitude angle (radians) 

20488 phi double latitude angle (radians) 

20489 r double radial distance 

20490 td double rate of change of theta 

20491 pd double rate of change of phi 

20492 rd double rate of change of r 

20493 

20494 Notes: 

20495 

20496 1) If the position part of pv is null, theta, phi, td and pd 

20497 are indeterminate. This is handled by extrapolating the 

20498 position through unit time by using the velocity part of 

20499 pv. This moves the origin without changing the direction 

20500 of the velocity component. If the position and velocity 

20501 components of pv are both null, zeroes are returned for all 

20502 six results. 

20503 

20504 2) If the position is a pole, theta, td and pd are indeterminate. 

20505 In such cases zeroes are returned for all three. 

20506 

20507 This revision: 2021 May 11 

20508 

20509 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20510 Derived, with permission, from the SOFA library. See notes at end of file. 

20511 

20512 """ 

20513 theta, phi, r, td, pd, rd = ufunc.pv2s(pv) 

20514 return theta, phi, r, td, pd, rd 

20515 

20516 

20517def s2c(theta, phi): 

20518 """ 

20519 Convert spherical coordinates to Cartesian. 

20520 

20521 Parameters 

20522 ---------- 

20523 theta : double array 

20524 phi : double array 

20525 

20526 Returns 

20527 ------- 

20528 c : double array 

20529 

20530 Notes 

20531 ----- 

20532 Wraps ERFA function ``eraS2c``. The ERFA documentation is:: 

20533 

20534 - - - - - - - 

20535 e r a S 2 c 

20536 - - - - - - - 

20537 

20538 Convert spherical coordinates to Cartesian. 

20539 

20540 Given: 

20541 theta double longitude angle (radians) 

20542 phi double latitude angle (radians) 

20543 

20544 Returned: 

20545 c double[3] direction cosines 

20546 

20547 This revision: 2021 May 11 

20548 

20549 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20550 Derived, with permission, from the SOFA library. See notes at end of file. 

20551 

20552 """ 

20553 c = ufunc.s2c(theta, phi) 

20554 return c 

20555 

20556 

20557def s2p(theta, phi, r): 

20558 """ 

20559 Convert spherical polar coordinates to p-vector. 

20560 

20561 Parameters 

20562 ---------- 

20563 theta : double array 

20564 phi : double array 

20565 r : double array 

20566 

20567 Returns 

20568 ------- 

20569 p : double array 

20570 

20571 Notes 

20572 ----- 

20573 Wraps ERFA function ``eraS2p``. The ERFA documentation is:: 

20574 

20575 - - - - - - - 

20576 e r a S 2 p 

20577 - - - - - - - 

20578 

20579 Convert spherical polar coordinates to p-vector. 

20580 

20581 Given: 

20582 theta double longitude angle (radians) 

20583 phi double latitude angle (radians) 

20584 r double radial distance 

20585 

20586 Returned: 

20587 p double[3] Cartesian coordinates 

20588 

20589 Called: 

20590 eraS2c spherical coordinates to unit vector 

20591 eraSxp multiply p-vector by scalar 

20592 

20593 This revision: 2021 May 11 

20594 

20595 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20596 Derived, with permission, from the SOFA library. See notes at end of file. 

20597 

20598 """ 

20599 p = ufunc.s2p(theta, phi, r) 

20600 return p 

20601 

20602 

20603def s2pv(theta, phi, r, td, pd, rd): 

20604 """ 

20605 Convert position/velocity from spherical to Cartesian coordinates. 

20606 

20607 Parameters 

20608 ---------- 

20609 theta : double array 

20610 phi : double array 

20611 r : double array 

20612 td : double array 

20613 pd : double array 

20614 rd : double array 

20615 

20616 Returns 

20617 ------- 

20618 pv : double array 

20619 

20620 Notes 

20621 ----- 

20622 Wraps ERFA function ``eraS2pv``. The ERFA documentation is:: 

20623 

20624 - - - - - - - - 

20625 e r a S 2 p v 

20626 - - - - - - - - 

20627 

20628 Convert position/velocity from spherical to Cartesian coordinates. 

20629 

20630 Given: 

20631 theta double longitude angle (radians) 

20632 phi double latitude angle (radians) 

20633 r double radial distance 

20634 td double rate of change of theta 

20635 pd double rate of change of phi 

20636 rd double rate of change of r 

20637 

20638 Returned: 

20639 pv double[2][3] pv-vector 

20640 

20641 This revision: 2021 May 11 

20642 

20643 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20644 Derived, with permission, from the SOFA library. See notes at end of file. 

20645 

20646 """ 

20647 pv = ufunc.s2pv(theta, phi, r, td, pd, rd) 

20648 return pv 

20649 

20650 

20651def pdp(a, b): 

20652 """ 

20653 p-vector inner (=scalar=dot) product. 

20654 

20655 Parameters 

20656 ---------- 

20657 a : double array 

20658 b : double array 

20659 

20660 Returns 

20661 ------- 

20662 c_retval : double array 

20663 

20664 Notes 

20665 ----- 

20666 Wraps ERFA function ``eraPdp``. The ERFA documentation is:: 

20667 

20668 - - - - - - - 

20669 e r a P d p 

20670 - - - - - - - 

20671 

20672 p-vector inner (=scalar=dot) product. 

20673 

20674 Given: 

20675 a double[3] first p-vector 

20676 b double[3] second p-vector 

20677 

20678 Returned (function value): 

20679 double a . b 

20680 

20681 This revision: 2021 May 11 

20682 

20683 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20684 Derived, with permission, from the SOFA library. See notes at end of file. 

20685 

20686 """ 

20687 c_retval = ufunc.pdp(a, b) 

20688 return c_retval 

20689 

20690 

20691def pm(p): 

20692 """ 

20693 Modulus of p-vector. 

20694 

20695 Parameters 

20696 ---------- 

20697 p : double array 

20698 

20699 Returns 

20700 ------- 

20701 c_retval : double array 

20702 

20703 Notes 

20704 ----- 

20705 Wraps ERFA function ``eraPm``. The ERFA documentation is:: 

20706 

20707 - - - - - - 

20708 e r a P m 

20709 - - - - - - 

20710 

20711 Modulus of p-vector. 

20712 

20713 Given: 

20714 p double[3] p-vector 

20715 

20716 Returned (function value): 

20717 double modulus 

20718 

20719 This revision: 2021 May 11 

20720 

20721 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20722 Derived, with permission, from the SOFA library. See notes at end of file. 

20723 

20724 """ 

20725 c_retval = ufunc.pm(p) 

20726 return c_retval 

20727 

20728 

20729def pmp(a, b): 

20730 """ 

20731 P-vector subtraction. 

20732 

20733 Parameters 

20734 ---------- 

20735 a : double array 

20736 b : double array 

20737 

20738 Returns 

20739 ------- 

20740 amb : double array 

20741 

20742 Notes 

20743 ----- 

20744 Wraps ERFA function ``eraPmp``. The ERFA documentation is:: 

20745 

20746 - - - - - - - 

20747 e r a P m p 

20748 - - - - - - - 

20749 

20750 P-vector subtraction. 

20751 

20752 Given: 

20753 a double[3] first p-vector 

20754 b double[3] second p-vector 

20755 

20756 Returned: 

20757 amb double[3] a - b 

20758 

20759 Note: 

20760 It is permissible to re-use the same array for any of the 

20761 arguments. 

20762 

20763 This revision: 2021 May 11 

20764 

20765 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20766 Derived, with permission, from the SOFA library. See notes at end of file. 

20767 

20768 """ 

20769 amb = ufunc.pmp(a, b) 

20770 return amb 

20771 

20772 

20773def pn(p): 

20774 """ 

20775 Convert a p-vector into modulus and unit vector. 

20776 

20777 Parameters 

20778 ---------- 

20779 p : double array 

20780 

20781 Returns 

20782 ------- 

20783 r : double array 

20784 u : double array 

20785 

20786 Notes 

20787 ----- 

20788 Wraps ERFA function ``eraPn``. The ERFA documentation is:: 

20789 

20790 - - - - - - 

20791 e r a P n 

20792 - - - - - - 

20793 

20794 Convert a p-vector into modulus and unit vector. 

20795 

20796 Given: 

20797 p double[3] p-vector 

20798 

20799 Returned: 

20800 r double modulus 

20801 u double[3] unit vector 

20802 

20803 Notes: 

20804 

20805 1) If p is null, the result is null. Otherwise the result is a unit 

20806 vector. 

20807 

20808 2) It is permissible to re-use the same array for any of the 

20809 arguments. 

20810 

20811 Called: 

20812 eraPm modulus of p-vector 

20813 eraZp zero p-vector 

20814 eraSxp multiply p-vector by scalar 

20815 

20816 This revision: 2021 May 11 

20817 

20818 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20819 Derived, with permission, from the SOFA library. See notes at end of file. 

20820 

20821 """ 

20822 r, u = ufunc.pn(p) 

20823 return r, u 

20824 

20825 

20826def ppp(a, b): 

20827 """ 

20828 P-vector addition. 

20829 

20830 Parameters 

20831 ---------- 

20832 a : double array 

20833 b : double array 

20834 

20835 Returns 

20836 ------- 

20837 apb : double array 

20838 

20839 Notes 

20840 ----- 

20841 Wraps ERFA function ``eraPpp``. The ERFA documentation is:: 

20842 

20843 - - - - - - - 

20844 e r a P p p 

20845 - - - - - - - 

20846 

20847 P-vector addition. 

20848 

20849 Given: 

20850 a double[3] first p-vector 

20851 b double[3] second p-vector 

20852 

20853 Returned: 

20854 apb double[3] a + b 

20855 

20856 Note: 

20857 It is permissible to re-use the same array for any of the 

20858 arguments. 

20859 

20860 This revision: 2021 May 11 

20861 

20862 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20863 Derived, with permission, from the SOFA library. See notes at end of file. 

20864 

20865 """ 

20866 apb = ufunc.ppp(a, b) 

20867 return apb 

20868 

20869 

20870def ppsp(a, s, b): 

20871 """ 

20872 P-vector plus scaled p-vector. 

20873 

20874 Parameters 

20875 ---------- 

20876 a : double array 

20877 s : double array 

20878 b : double array 

20879 

20880 Returns 

20881 ------- 

20882 apsb : double array 

20883 

20884 Notes 

20885 ----- 

20886 Wraps ERFA function ``eraPpsp``. The ERFA documentation is:: 

20887 

20888 - - - - - - - - 

20889 e r a P p s p 

20890 - - - - - - - - 

20891 

20892 P-vector plus scaled p-vector. 

20893 

20894 Given: 

20895 a double[3] first p-vector 

20896 s double scalar (multiplier for b) 

20897 b double[3] second p-vector 

20898 

20899 Returned: 

20900 apsb double[3] a + s*b 

20901 

20902 Note: 

20903 It is permissible for any of a, b and apsb to be the same array. 

20904 

20905 Called: 

20906 eraSxp multiply p-vector by scalar 

20907 eraPpp p-vector plus p-vector 

20908 

20909 This revision: 2021 May 11 

20910 

20911 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20912 Derived, with permission, from the SOFA library. See notes at end of file. 

20913 

20914 """ 

20915 apsb = ufunc.ppsp(a, s, b) 

20916 return apsb 

20917 

20918 

20919def pvdpv(a, b): 

20920 """ 

20921 Inner (=scalar=dot) product of two pv-vectors. 

20922 

20923 Parameters 

20924 ---------- 

20925 a : double array 

20926 b : double array 

20927 

20928 Returns 

20929 ------- 

20930 adb : double array 

20931 

20932 Notes 

20933 ----- 

20934 Wraps ERFA function ``eraPvdpv``. The ERFA documentation is:: 

20935 

20936 - - - - - - - - - 

20937 e r a P v d p v 

20938 - - - - - - - - - 

20939 

20940 Inner (=scalar=dot) product of two pv-vectors. 

20941 

20942 Given: 

20943 a double[2][3] first pv-vector 

20944 b double[2][3] second pv-vector 

20945 

20946 Returned: 

20947 adb double[2] a . b (see note) 

20948 

20949 Note: 

20950 

20951 If the position and velocity components of the two pv-vectors are 

20952 ( ap, av ) and ( bp, bv ), the result, a . b, is the pair of 

20953 numbers ( ap . bp , ap . bv + av . bp ). The two numbers are the 

20954 dot-product of the two p-vectors and its derivative. 

20955 

20956 Called: 

20957 eraPdp scalar product of two p-vectors 

20958 

20959 This revision: 2021 May 11 

20960 

20961 Copyright (C) 2013-2021, NumFOCUS Foundation. 

20962 Derived, with permission, from the SOFA library. See notes at end of file. 

20963 

20964 """ 

20965 adb = ufunc.pvdpv(a, b) 

20966 return adb 

20967 

20968 

20969def pvm(pv): 

20970 """ 

20971 Modulus of pv-vector. 

20972 

20973 Parameters 

20974 ---------- 

20975 pv : double array 

20976 

20977 Returns 

20978 ------- 

20979 r : double array 

20980 s : double array 

20981 

20982 Notes 

20983 ----- 

20984 Wraps ERFA function ``eraPvm``. The ERFA documentation is:: 

20985 

20986 - - - - - - - 

20987 e r a P v m 

20988 - - - - - - - 

20989 

20990 Modulus of pv-vector. 

20991 

20992 Given: 

20993 pv double[2][3] pv-vector 

20994 

20995 Returned: 

20996 r double modulus of position component 

20997 s double modulus of velocity component 

20998 

20999 Called: 

21000 eraPm modulus of p-vector 

21001 

21002 This revision: 2021 May 11 

21003 

21004 Copyright (C) 2013-2021, NumFOCUS Foundation. 

21005 Derived, with permission, from the SOFA library. See notes at end of file. 

21006 

21007 """ 

21008 r, s = ufunc.pvm(pv) 

21009 return r, s 

21010 

21011 

21012def pvmpv(a, b): 

21013 """ 

21014 Subtract one pv-vector from another. 

21015 

21016 Parameters 

21017 ---------- 

21018 a : double array 

21019 b : double array 

21020 

21021 Returns 

21022 ------- 

21023 amb : double array 

21024 

21025 Notes 

21026 ----- 

21027 Wraps ERFA function ``eraPvmpv``. The ERFA documentation is:: 

21028 

21029 - - - - - - - - - 

21030 e r a P v m p v 

21031 - - - - - - - - - 

21032 

21033 Subtract one pv-vector from another. 

21034 

21035 Given: 

21036 a double[2][3] first pv-vector 

21037 b double[2][3] second pv-vector 

21038 

21039 Returned: 

21040 amb double[2][3] a - b 

21041 

21042 Note: 

21043 It is permissible to re-use the same array for any of the 

21044 arguments. 

21045 

21046 Called: 

21047 eraPmp p-vector minus p-vector 

21048 

21049 This revision: 2021 May 11 

21050 

21051 Copyright (C) 2013-2021, NumFOCUS Foundation. 

21052 Derived, with permission, from the SOFA library. See notes at end of file. 

21053 

21054 """ 

21055 amb = ufunc.pvmpv(a, b) 

21056 return amb 

21057 

21058 

21059def pvppv(a, b): 

21060 """ 

21061 Add one pv-vector to another. 

21062 

21063 Parameters 

21064 ---------- 

21065 a : double array 

21066 b : double array 

21067 

21068 Returns 

21069 ------- 

21070 apb : double array 

21071 

21072 Notes 

21073 ----- 

21074 Wraps ERFA function ``eraPvppv``. The ERFA documentation is:: 

21075 

21076 - - - - - - - - - 

21077 e r a P v p p v 

21078 - - - - - - - - - 

21079 

21080 Add one pv-vector to another. 

21081 

21082 Given: 

21083 a double[2][3] first pv-vector 

21084 b double[2][3] second pv-vector 

21085 

21086 Returned: 

21087 apb double[2][3] a + b 

21088 

21089 Note: 

21090 It is permissible to re-use the same array for any of the 

21091 arguments. 

21092 

21093 Called: 

21094 eraPpp p-vector plus p-vector 

21095 

21096 This revision: 2021 May 11 

21097 

21098 Copyright (C) 2013-2021, NumFOCUS Foundation. 

21099 Derived, with permission, from the SOFA library. See notes at end of file. 

21100 

21101 """ 

21102 apb = ufunc.pvppv(a, b) 

21103 return apb 

21104 

21105 

21106def pvu(dt, pv): 

21107 """ 

21108 Update a pv-vector. 

21109 

21110 Parameters 

21111 ---------- 

21112 dt : double array 

21113 pv : double array 

21114 

21115 Returns 

21116 ------- 

21117 upv : double array 

21118 

21119 Notes 

21120 ----- 

21121 Wraps ERFA function ``eraPvu``. The ERFA documentation is:: 

21122 

21123 - - - - - - - 

21124 e r a P v u 

21125 - - - - - - - 

21126 

21127 Update a pv-vector. 

21128 

21129 Given: 

21130 dt double time interval 

21131 pv double[2][3] pv-vector 

21132 

21133 Returned: 

21134 upv double[2][3] p updated, v unchanged 

21135 

21136 Notes: 

21137 

21138 1) "Update" means "refer the position component of the vector 

21139 to a new date dt time units from the existing date". 

21140 

21141 2) The time units of dt must match those of the velocity. 

21142 

21143 3) It is permissible for pv and upv to be the same array. 

21144 

21145 Called: 

21146 eraPpsp p-vector plus scaled p-vector 

21147 eraCp copy p-vector 

21148 

21149 This revision: 2021 May 11 

21150 

21151 Copyright (C) 2013-2021, NumFOCUS Foundation. 

21152 Derived, with permission, from the SOFA library. See notes at end of file. 

21153 

21154 """ 

21155 upv = ufunc.pvu(dt, pv) 

21156 return upv 

21157 

21158 

21159def pvup(dt, pv): 

21160 """ 

21161 Update a pv-vector, discarding the velocity component. 

21162 

21163 Parameters 

21164 ---------- 

21165 dt : double array 

21166 pv : double array 

21167 

21168 Returns 

21169 ------- 

21170 p : double array 

21171 

21172 Notes 

21173 ----- 

21174 Wraps ERFA function ``eraPvup``. The ERFA documentation is:: 

21175 

21176 - - - - - - - - 

21177 e r a P v u p 

21178 - - - - - - - - 

21179 

21180 Update a pv-vector, discarding the velocity component. 

21181 

21182 Given: 

21183 dt double time interval 

21184 pv double[2][3] pv-vector 

21185 

21186 Returned: 

21187 p double[3] p-vector 

21188 

21189 Notes: 

21190 

21191 1) "Update" means "refer the position component of the vector to a 

21192 new date dt time units from the existing date". 

21193 

21194 2) The time units of dt must match those of the velocity. 

21195 

21196 This revision: 2021 May 11 

21197 

21198 Copyright (C) 2013-2021, NumFOCUS Foundation. 

21199 Derived, with permission, from the SOFA library. See notes at end of file. 

21200 

21201 """ 

21202 p = ufunc.pvup(dt, pv) 

21203 return p 

21204 

21205 

21206def pvxpv(a, b): 

21207 """ 

21208 Outer (=vector=cross) product of two pv-vectors. 

21209 

21210 Parameters 

21211 ---------- 

21212 a : double array 

21213 b : double array 

21214 

21215 Returns 

21216 ------- 

21217 axb : double array 

21218 

21219 Notes 

21220 ----- 

21221 Wraps ERFA function ``eraPvxpv``. The ERFA documentation is:: 

21222 

21223 - - - - - - - - - 

21224 e r a P v x p v 

21225 - - - - - - - - - 

21226 

21227 Outer (=vector=cross) product of two pv-vectors. 

21228 

21229 Given: 

21230 a double[2][3] first pv-vector 

21231 b double[2][3] second pv-vector 

21232 

21233 Returned: 

21234 axb double[2][3] a x b 

21235 

21236 Notes: 

21237 

21238 1) If the position and velocity components of the two pv-vectors are 

21239 ( ap, av ) and ( bp, bv ), the result, a x b, is the pair of 

21240 vectors ( ap x bp, ap x bv + av x bp ). The two vectors are the 

21241 cross-product of the two p-vectors and its derivative. 

21242 

21243 2) It is permissible to re-use the same array for any of the 

21244 arguments. 

21245 

21246 Called: 

21247 eraCpv copy pv-vector 

21248 eraPxp vector product of two p-vectors 

21249 eraPpp p-vector plus p-vector 

21250 

21251 This revision: 2021 May 11 

21252 

21253 Copyright (C) 2013-2021, NumFOCUS Foundation. 

21254 Derived, with permission, from the SOFA library. See notes at end of file. 

21255 

21256 """ 

21257 axb = ufunc.pvxpv(a, b) 

21258 return axb 

21259 

21260 

21261def pxp(a, b): 

21262 """ 

21263 p-vector outer (=vector=cross) product. 

21264 

21265 Parameters 

21266 ---------- 

21267 a : double array 

21268 b : double array 

21269 

21270 Returns 

21271 ------- 

21272 axb : double array 

21273 

21274 Notes 

21275 ----- 

21276 Wraps ERFA function ``eraPxp``. The ERFA documentation is:: 

21277 

21278 - - - - - - - 

21279 e r a P x p 

21280 - - - - - - - 

21281 

21282 p-vector outer (=vector=cross) product. 

21283 

21284 Given: 

21285 a double[3] first p-vector 

21286 b double[3] second p-vector 

21287 

21288 Returned: 

21289 axb double[3] a x b 

21290 

21291 Note: 

21292 It is permissible to re-use the same array for any of the 

21293 arguments. 

21294 

21295 This revision: 2021 May 11 

21296 

21297 Copyright (C) 2013-2021, NumFOCUS Foundation. 

21298 Derived, with permission, from the SOFA library. See notes at end of file. 

21299 

21300 """ 

21301 axb = ufunc.pxp(a, b) 

21302 return axb 

21303 

21304 

21305def s2xpv(s1, s2, pv): 

21306 """ 

21307 Multiply a pv-vector by two scalars. 

21308 

21309 Parameters 

21310 ---------- 

21311 s1 : double array 

21312 s2 : double array 

21313 pv : double array 

21314 

21315 Returns 

21316 ------- 

21317 spv : double array 

21318 

21319 Notes 

21320 ----- 

21321 Wraps ERFA function ``eraS2xpv``. The ERFA documentation is:: 

21322 

21323 - - - - - - - - - 

21324 e r a S 2 x p v 

21325 - - - - - - - - - 

21326 

21327 Multiply a pv-vector by two scalars. 

21328 

21329 Given: 

21330 s1 double scalar to multiply position component by 

21331 s2 double scalar to multiply velocity component by 

21332 pv double[2][3] pv-vector 

21333 

21334 Returned: 

21335 spv double[2][3] pv-vector: p scaled by s1, v scaled by s2 

21336 

21337 Note: 

21338 It is permissible for pv and spv to be the same array. 

21339 

21340 Called: 

21341 eraSxp multiply p-vector by scalar 

21342 

21343 This revision: 2021 May 11 

21344 

21345 Copyright (C) 2013-2021, NumFOCUS Foundation. 

21346 Derived, with permission, from the SOFA library. See notes at end of file. 

21347 

21348 """ 

21349 spv = ufunc.s2xpv(s1, s2, pv) 

21350 return spv 

21351 

21352 

21353def sxp(s, p): 

21354 """ 

21355 Multiply a p-vector by a scalar. 

21356 

21357 Parameters 

21358 ---------- 

21359 s : double array 

21360 p : double array 

21361 

21362 Returns 

21363 ------- 

21364 sp : double array 

21365 

21366 Notes 

21367 ----- 

21368 Wraps ERFA function ``eraSxp``. The ERFA documentation is:: 

21369 

21370 - - - - - - - 

21371 e r a S x p 

21372 - - - - - - - 

21373 

21374 Multiply a p-vector by a scalar. 

21375 

21376 Given: 

21377 s double scalar 

21378 p double[3] p-vector 

21379 

21380 Returned: 

21381 sp double[3] s * p 

21382 

21383 Note: 

21384 It is permissible for p and sp to be the same array. 

21385 

21386 This revision: 2021 May 11 

21387 

21388 Copyright (C) 2013-2021, NumFOCUS Foundation. 

21389 Derived, with permission, from the SOFA library. See notes at end of file. 

21390 

21391 """ 

21392 sp = ufunc.sxp(s, p) 

21393 return sp 

21394 

21395 

21396def sxpv(s, pv): 

21397 """ 

21398 Multiply a pv-vector by a scalar. 

21399 

21400 Parameters 

21401 ---------- 

21402 s : double array 

21403 pv : double array 

21404 

21405 Returns 

21406 ------- 

21407 spv : double array 

21408 

21409 Notes 

21410 ----- 

21411 Wraps ERFA function ``eraSxpv``. The ERFA documentation is:: 

21412 

21413 - - - - - - - - 

21414 e r a S x p v 

21415 - - - - - - - - 

21416 

21417 Multiply a pv-vector by a scalar. 

21418 

21419 Given: 

21420 s double scalar 

21421 pv double[2][3] pv-vector 

21422 

21423 Returned: 

21424 spv double[2][3] s * pv 

21425 

21426 Note: 

21427 It is permissible for pv and spv to be the same array. 

21428 

21429 Called: 

21430 eraS2xpv multiply pv-vector by two scalars 

21431 

21432 This revision: 2021 May 11 

21433 

21434 Copyright (C) 2013-2021, NumFOCUS Foundation. 

21435 Derived, with permission, from the SOFA library. See notes at end of file. 

21436 

21437 """ 

21438 spv = ufunc.sxpv(s, pv) 

21439 return spv